You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-30 02:21:17 +03:00
Use cheerio api for code replacements
This commit is contained in:
@ -128,9 +128,8 @@ export function htmlSerializeIfNeeded(model: EditorModel, {forceHTML = false} =
|
|||||||
// since maths delimiters are handled before Markdown,
|
// since maths delimiters are handled before Markdown,
|
||||||
// code blocks could contain mangled content.
|
// code blocks could contain mangled content.
|
||||||
// replace code blocks with original content
|
// replace code blocks with original content
|
||||||
phtml('code').contents().each(function(i) {
|
phtmlOrig('code').each(function(i) {
|
||||||
const origData = phtmlOrig('code').contents()[i].data;
|
phtml('code').eq(i).text(phtmlOrig('code').eq(i).text());
|
||||||
phtml('code').contents()[i].data = origData;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// add fallback output for latex math, which should not be interpreted as markdown
|
// add fallback output for latex math, which should not be interpreted as markdown
|
||||||
|
Reference in New Issue
Block a user