From c6d8bbae1601fb8c880b4568c2bbe3d2dfe50187 Mon Sep 17 00:00:00 2001 From: Louis David Bolack Date: Fri, 10 Nov 2023 23:09:49 -0600 Subject: [PATCH] Update shared/naturalcrit/markdown.js Co-authored-by: Trevor Buckner --- shared/naturalcrit/markdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 26bc810e4..c7b389b5a 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -211,7 +211,7 @@ const superSubScripts = { level : 'inline', 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 = /^\^\^([^\s\^][^\^]*[^\s\^])\^\^/m; + const superRegex = /^\^\^(?!\s)(?=([^\n\^]*[^\s\^]))\1\^\^/m; const subRegex = /^\^\^\^([^\s\^][^\^]*[^\s\^])\^\^\^/m; let isSuper = false; let match = subRegex.exec(src);