File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -276,8 +276,8 @@ document.addEventListener("DOMContentLoaded", function () {
276276 const BLOCK_MATH_MARKER_PATTERN = / ^ \$ \$ / m;
277277 const BLOCK_MATH_PATTERN = / ^ \$ \$ [ \t ] * \n ? ( [ \s \S ] * ?) \n ? \$ \$ [ \t ] * (?: \n | $ ) / ;
278278 const DEFINITION_LIST_ITEM_PATTERN = / ^ : [ \t ] + ( .* ) $ / ;
279- const SUPERSCRIPT_PATTERN = / ^ \^ ( [ ^ ^ \n ] + ) \^ / ;
280- const SUBSCRIPT_PATTERN = / ^ ~ (? ! ~ ) ( [ ^ ~ \n ] + ) ~ / ;
279+ const SUPERSCRIPT_PATTERN = / ^ \^ (? ! \s ) ( [ ^ ^ \n ] * ? \S ) \^ (? ! \^ ) / ;
280+ const SUBSCRIPT_PATTERN = / ^ ~ (? ! ~ ) (? ! \s ) ( [ ^ ~ \n ] * ? \S ) ~ (? ! ~ ) / ;
281281 const HIGHLIGHT_PATTERN = / ^ = = (? = \S ) ( [ \s \S ] * ?\S ) = = / ;
282282 const MARKDOWN_LIST_MARKER_PATTERN = / ^ ( \s * ) (?: [ - * + ] \s + | \d + \. \s + | > \s + ) / ;
283283 const EMPTY_LINE_PATTERN = / ^ \s * $ / ;
Original file line number Diff line number Diff line change @@ -276,8 +276,8 @@ document.addEventListener("DOMContentLoaded", function () {
276276 const BLOCK_MATH_MARKER_PATTERN = / ^ \$ \$ / m;
277277 const BLOCK_MATH_PATTERN = / ^ \$ \$ [ \t ] * \n ? ( [ \s \S ] * ?) \n ? \$ \$ [ \t ] * (?: \n | $ ) / ;
278278 const DEFINITION_LIST_ITEM_PATTERN = / ^ : [ \t ] + ( .* ) $ / ;
279- const SUPERSCRIPT_PATTERN = / ^ \^ ( [ ^ ^ \n ] + ) \^ / ;
280- const SUBSCRIPT_PATTERN = / ^ ~ (? ! ~ ) ( [ ^ ~ \n ] + ) ~ / ;
279+ const SUPERSCRIPT_PATTERN = / ^ \^ (? ! \s ) ( [ ^ ^ \n ] * ? \S ) \^ (? ! \^ ) / ;
280+ const SUBSCRIPT_PATTERN = / ^ ~ (? ! ~ ) (? ! \s ) ( [ ^ ~ \n ] * ? \S ) ~ (? ! ~ ) / ;
281281 const HIGHLIGHT_PATTERN = / ^ = = (? = \S ) ( [ \s \S ] * ?\S ) = = / ;
282282 const MARKDOWN_LIST_MARKER_PATTERN = / ^ ( \s * ) (?: [ - * + ] \s + | \d + \. \s + | > \s + ) / ;
283283 const EMPTY_LINE_PATTERN = / ^ \s * $ / ;
You can’t perform that action at this time.
0 commit comments