From 537150415462785deb1e00e15faaeeb5aa84c96e Mon Sep 17 00:00:00 2001 From: Changmin Choi Date: Thu, 2 Jan 2020 17:09:22 +0900 Subject: [PATCH] fix to find latex phrase in markdown style --- script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script.js b/script.js index 16e8e3d..ba20af8 100644 --- a/script.js +++ b/script.js @@ -23,10 +23,10 @@ function rerender_all() { var code = document.querySelectorAll("span[style*=\"monospace\"]") code.forEach(function(el) { var s = el.textContent - if (s.startsWith("math:")) { + if (s.startsWith("$$") && s.endsWith("$$")) { el.style.color = null el.style.background = null - s = s.slice(5).trim() + s = s.slice(2,-2).trim() console.log("rendering ", s) katex.render(s, el, {throwOnError: false, font: 'mathit'}) }