Skip to content

Commit b5e64a2

Browse files
committed
fix
1 parent a3b62af commit b5e64a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mod.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import markedFootnote from "marked-footnote";
66
import { gfmHeadingId } from "marked-gfm-heading-id";
77
import Prism from "prismjs";
88
import sanitizeHtml from "sanitize-html";
9-
import htmlEscape from "he";
9+
import he from "he";
1010
import katex from "katex";
1111

1212
import { CSS, KATEX_CLASSES, KATEX_CSS } from "./style.js";
@@ -56,7 +56,7 @@ export class Renderer extends Marked.Renderer {
5656
? Prism.languages[language]
5757
: undefined;
5858
if (grammar === undefined) {
59-
return `<pre><code class="notranslate">${htmlEscape(code)}</code></pre>`;
59+
return `<pre><code class="notranslate">${he.encode(code)}</code></pre>`;
6060
}
6161
const html = Prism.highlight(code, grammar, language!);
6262
return `<div class="highlight highlight-source-${language} notranslate"><pre>${html}</pre></div>`;

0 commit comments

Comments
 (0)