summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/notebook
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-05-30 14:53:12 +0100
committerPhil Hughes <me@iamphill.com>2017-05-30 16:00:57 +0100
commite53a00962941bce0b084607d630ec8eb33824a34 (patch)
tree47da9e0493b85693db168d9e83969df674f46a9c /app/assets/javascripts/notebook
parent8e74fcbc45bb110e7574f4e7e5ee72dea6b21675 (diff)
downloadgitlab-ce-e53a00962941bce0b084607d630ec8eb33824a34.tar.gz
fixed inline math
Diffstat (limited to 'app/assets/javascripts/notebook')
-rw-r--r--app/assets/javascripts/notebook/cells/markdown.vue3
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;