From 494ae3e4215cc2fe0583c316b8ea1d895503d39e Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Thu, 26 Nov 2020 17:45:11 +0000 Subject: [PATCH] parse html for latex rendering inside settings block --- src/HtmlUtils.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/HtmlUtils.tsx b/src/HtmlUtils.tsx index 44fbffb97f..43aeae24e6 100644 --- a/src/HtmlUtils.tsx +++ b/src/HtmlUtils.tsx @@ -418,10 +418,10 @@ export function bodyToHtml(content: IContent, highlights: string[], opts: IOpts if (isHtmlMessage) { isDisplayedWithHtml = true; safeBody = sanitizeHtml(formattedBody, sanitizeParams); - const phtml = cheerio.load(safeBody, - { _useHtmlParser2: true, decodeEntities: false }) if (SettingsStore.getValue("feature_latex_maths")) { + const phtml = cheerio.load(safeBody, + { _useHtmlParser2: true, decodeEntities: false }) phtml('div, span[data-mx-maths!=""]').replaceWith(function(i, e) { return katex.renderToString( AllHtmlEntities.decode(phtml(e).attr('data-mx-maths')),