insomnia/packages/insomnia-app/app/common/markdown-to-html.ts
2022-03-10 20:14:54 +00:00

14 lines
303 B
TypeScript

import { sanitize } from 'dompurify';
import { marked } from 'marked';
marked.setOptions({
renderer: new marked.Renderer(),
gfm: true,
breaks: false,
pedantic: false,
smartLists: true,
smartypants: false,
});
export const markdownToHTML = (input: string) => sanitize(marked.parse(input));