diff --git a/server/prisma/dev.db b/server/prisma/dev.db index 9ae4460..7815d9b 100644 Binary files a/server/prisma/dev.db and b/server/prisma/dev.db differ diff --git a/webapp/src/lib/marked/extensions.ts b/webapp/src/lib/marked/extensions.ts index 9430090..d2c135a 100644 --- a/webapp/src/lib/marked/extensions.ts +++ b/webapp/src/lib/marked/extensions.ts @@ -83,8 +83,9 @@ const MathInline = { }, tokenizer(src: string) { - const match = src.match(/^(\${1})((?:\\.|.)+)\1/); + const match = src.match(/^(\${1})((?:\\.|[^$])+)\1/); if (match) { + console.log(src, match); return { type: 'math-inline', raw: match[0], @@ -103,8 +104,7 @@ const MathBlock = { }, tokenizer(src: string) { - // console.log(src); - const match = src.match(/^(\${2})((?:\\.|.|\n)+)\1/m); + const match = src.match(/^(\${2})((?:\\.|[^$]|\n)+)\1/); if (match) { console.log(src, match); return { @@ -117,13 +117,46 @@ const MathBlock = { } }; +// const MathInline = { +// name: 'math-block', +// level: 'inline', +// start(src: string) { +// return src.indexOf('$'); +// }, + +// tokenizer(src: string) { +// // console.log(src); +// const match = src.match(/^(\${1,2})((?:\\.|[^$]|\n)+)\1/m); +// if (match) { +// console.log(src, match); +// if (match[1] == '$') { +// console.log('inline'); +// return { +// type: 'math-inline', +// raw: match[0], +// text: match[2].trim() +// }; +// } else if (match[1] == '$$') { +// console.log('block'); + +// return { +// type: 'math-block', +// raw: match[0], +// text: match[2].trim() +// }; +// } +// } +// return false; +// } +// }; + export default [ InternalLinkExtension, InternalEmbedExtension, TagExtension, HighlightExtension, - MathInline, - MathBlock + MathBlock, + MathInline ]; // ^\#([\w\/]+)\W*