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

Commit

Permalink
Use cheerio api for code replacements
Browse files Browse the repository at this point in the history
  • Loading branch information
rda0 committed Apr 8, 2021
1 parent 7205995 commit 31e85ec
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/editor/serialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 31e85ec

Please sign in to comment.