From 8f62f9902d5a038d23b061d02772f9e20a328d80 Mon Sep 17 00:00:00 2001 From: hlyang1992 Date: Sat, 30 May 2020 07:09:11 +0800 Subject: [PATCH] Fixes #1333: Fix formula automatic numbering is invalid (#1398) * Fix formula automatic numbering is invalid * resetting automatic equation numbering in preview --- src/resources/markdown_template.html | 3 ++- src/resources/mathjax_preview.js | 1 + src/resources/mathjax_preview_template.html | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/resources/markdown_template.html b/src/resources/markdown_template.html index 0ff658cb..474ca42c 100644 --- a/src/resources/markdown_template.html +++ b/src/resources/markdown_template.html @@ -32,7 +32,8 @@ diff --git a/src/resources/mathjax_preview.js b/src/resources/mathjax_preview.js index 4c247261..017280e3 100644 --- a/src/resources/mathjax_preview.js +++ b/src/resources/mathjax_preview.js @@ -71,6 +71,7 @@ var previewMathJax = function(identifier, id, timeStamp, text, isHtml) { if (text.indexOf('$$') !== -1) { isBlock = true; } + MathJax.texReset(); MathJax .typesetPromise([p]) .then(function () { diff --git a/src/resources/mathjax_preview_template.html b/src/resources/mathjax_preview_template.html index 2c962053..da07a7ee 100644 --- a/src/resources/mathjax_preview_template.html +++ b/src/resources/mathjax_preview_template.html @@ -13,7 +13,8 @@