Skip to content

Commit 0a006c2

Browse files
committed
allow html content
1 parent 8956a5f commit 0a006c2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/lib/markdownToHtml.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@ import rehypeStringify from "rehype-stringify";
77
export default async function markdownToHtml(markdown: string) {
88
const result = await remark()
99
.use(remarkGfm)
10-
.use(remarkRehype)
10+
.use(remarkRehype, {
11+
allowDangerousHtml: true,
12+
allowedElements: false, // Allow html syntax in markdown
13+
})
1114
.use(rehypeHighlight)
12-
.use(rehypeStringify)
15+
.use(rehypeStringify, {
16+
allowDangerousHtml: true
17+
})
1318
.process(markdown);
1419

1520
return result.toString();

0 commit comments

Comments
 (0)