Skip to content

Commit

Permalink
Fix breakline extraction bug
Browse files Browse the repository at this point in the history
  • Loading branch information
JonBunator committed Nov 3, 2023
1 parent 9879580 commit f430c1f
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ export default async function parseMarkdown(

// parses breaklines in markdown
async function extractBreaklines(value: string) {
const regex = /(\n{2,})/g;
const regex = /\n{2,}/g;
let match;
let start = 0;
// eslint-disable-next-line no-cond-assign
while ((match = regex.exec(markdown)) != null) {
while ((match = regex.exec(value)) != null) {
const markdownParsed = await parseSaveMarkdown(
value.substring(start, match.index),
);
Expand All @@ -120,7 +120,7 @@ export default async function parseMarkdown(
await addMarkdown(markdownParsed);
}

// extract MathJax and markdown to compiledCode list
// extract MathJax and markdown
async function extractMarkdownMathJax(value: string) {
const regex = /\$(.*?)\$/g;
let match;
Expand All @@ -146,6 +146,5 @@ export default async function parseMarkdown(
start = regex.lastIndex;
}
await extractMarkdownMathJax(markdown.substring(start));

return compiledCode;
}

0 comments on commit f430c1f

Please sign in to comment.