diff --git a/src/app/entry/entry_converter.ts b/src/app/entry/entry_converter.ts index 72652681e..1d0189c5e 100644 --- a/src/app/entry/entry_converter.ts +++ b/src/app/entry/entry_converter.ts @@ -1,21 +1,15 @@ -import rehypePrism from '@mapbox/rehype-prism'; -import html from 'rehype-stringify'; import breaks from 'remark-breaks'; import gfm from 'remark-gfm'; -import markdown from 'remark-parse'; -import remarkToRehype from 'remark-rehype'; +import html from 'remark-html'; +import parse from 'remark-parse'; import stringify from 'remark-stringify'; import strip from 'strip-markdown'; import { unified } from 'unified'; -const markdownProcessor = unified().use(markdown).use(gfm); +const markdownProcessor = unified().use(parse).use(gfm); export async function convertMarkdownToHtml(markdownText: string): Promise { - const processor = markdownProcessor() - .use(breaks) - .use(remarkToRehype, { allowDangerousHtml: true }) - .use(rehypePrism, { ignoreMissing: true }) - .use(html, { allowDangerousHtml: true }); + const processor = markdownProcessor().use(breaks).use(html, { sanitize: false }); return (await processor.process(markdownText)).value.toString(); }