From 8e74fcbc45bb110e7574f4e7e5ee72dea6b21675 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 30 May 2017 13:41:14 +0100 Subject: fixed spacing before inline math --- app/assets/javascripts/notebook/cells/markdown.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/assets/javascripts/notebook/cells/markdown.vue b/app/assets/javascripts/notebook/cells/markdown.vue index 2720c4cb994..77264b162a5 100644 --- a/app/assets/javascripts/notebook/cells/markdown.vue +++ b/app/assets/javascripts/notebook/cells/markdown.vue @@ -57,7 +57,8 @@ inline = true; while (matches !== null) { - text = `${text.replace(matches[0], katex.renderToString(matches[0].replace(/\$/g, '')))}`; + const renderedKatex = katex.renderToString(matches[0].replace(/\$/g, '')); + text = `${text.replace(matches[0], ` ${renderedKatex}`)}`; matches = regex.exec(katexString); } } else { -- cgit v1.2.3