diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 62e826e67..26bc810e4 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -209,10 +209,10 @@ const mustacheInjectBlock = { const superSubScripts = { name : 'superSubScripts', level : 'inline', - start(src) { return src.match(/.*\^\^(.+)\^\^/)?.index; }, // Hint to Marked.js to stop and check for a match + start(src) { return src.match(/\^\^[^\s].+[^\s]\^\^/m)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { - const superRegex = /\^\^(.+)\^\^/y; - const subRegex = /\^\^\^(.+)\^\^\^/y; + const superRegex = /^\^\^([^\s\^][^\^]*[^\s\^])\^\^/m; + const subRegex = /^\^\^\^([^\s\^][^\^]*[^\s\^])\^\^\^/m; let isSuper = false; let match = subRegex.exec(src); if(!match){