diff options
-rw-r--r-- | app/assets/javascripts/notebook/cells/markdown.vue | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/assets/javascripts/notebook/cells/markdown.vue b/app/assets/javascripts/notebook/cells/markdown.vue index 77264b162a5..814d2ea92b4 100644 --- a/app/assets/javascripts/notebook/cells/markdown.vue +++ b/app/assets/javascripts/notebook/cells/markdown.vue @@ -49,10 +49,11 @@ .replace(/&=&/g, '\\space=\\space') .replace(/<(\/?)em>/g, '_'); const regex = new RegExp(katexRegexString, 'gi'); + const matchLocation = katexString.search(regex); const numberOfMatches = katexString.match(regex); if (numberOfMatches && numberOfMatches.length !== 0) { - if (numberOfMatches.length > 1) { + if (matchLocation > 0) { let matches = regex.exec(katexString); inline = true; |