Use cheerio api for code replacements

pull/21833/head
Sven Mäder 2021-04-08 11:38:05 +02:00
parent 7205995dea
commit 31e85ec580
1 changed files with 2 additions and 3 deletions

View File

@ -128,9 +128,8 @@ export function htmlSerializeIfNeeded(model: EditorModel, {forceHTML = false} =
// since maths delimiters are handled before Markdown,
// code blocks could contain mangled content.
// replace code blocks with original content
phtml('code').contents().each(function(i) {
const origData = phtmlOrig('code').contents()[i].data;
phtml('code').contents()[i].data = origData;
phtmlOrig('code').each(function(i) {
phtml('code').eq(i).text(phtmlOrig('code').eq(i).text());
});
// add fallback output for latex math, which should not be interpreted as markdown