parse html for latex rendering inside settings block
This commit is contained in:
parent
7013483dad
commit
494ae3e421
1 changed files with 2 additions and 2 deletions
|
@ -418,10 +418,10 @@ export function bodyToHtml(content: IContent, highlights: string[], opts: IOpts
|
||||||
if (isHtmlMessage) {
|
if (isHtmlMessage) {
|
||||||
isDisplayedWithHtml = true;
|
isDisplayedWithHtml = true;
|
||||||
safeBody = sanitizeHtml(formattedBody, sanitizeParams);
|
safeBody = sanitizeHtml(formattedBody, sanitizeParams);
|
||||||
const phtml = cheerio.load(safeBody,
|
|
||||||
{ _useHtmlParser2: true, decodeEntities: false })
|
|
||||||
|
|
||||||
if (SettingsStore.getValue("feature_latex_maths")) {
|
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) {
|
phtml('div, span[data-mx-maths!=""]').replaceWith(function(i, e) {
|
||||||
return katex.renderToString(
|
return katex.renderToString(
|
||||||
AllHtmlEntities.decode(phtml(e).attr('data-mx-maths')),
|
AllHtmlEntities.decode(phtml(e).attr('data-mx-maths')),
|
||||||
|
|
Loading…
Reference in a new issue