mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-03-25 23:38:14 +00:00
match regex properly
This commit is contained in:
@@ -29,8 +29,8 @@ export function tokenizeCustomMarkdown(text) {
|
|||||||
|
|
||||||
lines.forEach((lineText, lineNumber) => {
|
lines.forEach((lineText, lineNumber) => {
|
||||||
// --- Page / snippet lines ---
|
// --- Page / snippet lines ---
|
||||||
if (/\\page/.test(lineText)) tokens.push({ line: lineNumber, type: customTags.pageLine });
|
if (/^(?=\\page(?:break)?(?: *{[^\n{}]*})?$)/m.test(lineText)) tokens.push({ line: lineNumber, type: customTags.pageLine });
|
||||||
if (/\\snippet/.test(lineText)) tokens.push({ line: lineNumber, type: customTags.snippetLine });
|
if (/^\\snippet\ .*$/.test(lineText)) tokens.push({ line: lineNumber, type: customTags.snippetLine });
|
||||||
if (/^\\column(?:break)?$/.test(lineText)) tokens.push({ line: lineNumber, type: customTags.columnSplit });
|
if (/^\\column(?:break)?$/.test(lineText)) tokens.push({ line: lineNumber, type: customTags.columnSplit });
|
||||||
if (/\\snippet/.test(lineText)) tokens.push({ line: lineNumber, type: customTags.snippetBreak });
|
if (/\\snippet/.test(lineText)) tokens.push({ line: lineNumber, type: customTags.snippetBreak });
|
||||||
|
|
||||||
@@ -185,7 +185,6 @@ export function tokenizeCustomMarkdown(text) {
|
|||||||
to: match.index + match[1].length +1,
|
to: match.index + match[1].length +1,
|
||||||
type: customTags.injection,
|
type: customTags.injection,
|
||||||
});
|
});
|
||||||
console.log(match);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (lineText.includes("{{") && lineText.includes("}}")) {
|
if (lineText.includes("{{") && lineText.includes("}}")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user