We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 52b7d0d commit 38cca9fCopy full SHA for 38cca9f
src/helper/enumerate-entries.ts
@@ -42,7 +42,7 @@ export function enumerateContents(
42
}
43
44
export function textNodeToHTML(node: TextNode, renderOption: RenderOption): string {
45
- let text = node.text;
+ let text = escapeHtml(node.text);
46
if (node.classname || node.id) {
47
text = (renderOption[MarkType.CLASSNAME_OR_ID] as RenderMark)(text, node.classname, node.id);
48
@@ -158,3 +158,10 @@ function nodeToHTML(
158
159
160
161
+
162
+function escapeHtml(text: string): string {
163
+ return text
164
+ .replace(/&/g, '&')
165
+ .replace(/</g, '<')
166
+ .replace(/>/g, '>')
167
+}
0 commit comments