From e53a00962941bce0b084607d630ec8eb33824a34 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 30 May 2017 14:53:12 +0100 Subject: fixed inline math --- app/assets/javascripts/notebook/cells/markdown.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/assets/javascripts/notebook') 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; -- cgit v1.2.3