Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 31e85ec

Browse files
committed
Use cheerio api for code replacements
1 parent 7205995 commit 31e85ec

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/editor/serialize.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,8 @@ export function htmlSerializeIfNeeded(model: EditorModel, {forceHTML = false} =
128128
// since maths delimiters are handled before Markdown,
129129
// code blocks could contain mangled content.
130130
// replace code blocks with original content
131-
phtml('code').contents().each(function(i) {
132-
const origData = phtmlOrig('code').contents()[i].data;
133-
phtml('code').contents()[i].data = origData;
131+
phtmlOrig('code').each(function(i) {
132+
phtml('code').eq(i).text(phtmlOrig('code').eq(i).text());
134133
});
135134

136135
// add fallback output for latex math, which should not be interpreted as markdown

0 commit comments

Comments
 (0)