1
0
mirror of https://github.com/tabler/tabler.git synced 2026-08-07 03:42:27 +04:00
Files
tabler/shared/lib/render-markdown.ts
2026-08-03 00:55:32 +02:00

15 lines
443 B
TypeScript

// Renders markdown to HTML with markdown-it (html: true, indented code blocks off).
// @ts-ignore -- markdown-it ships no type declarations and @types/markdown-it
// is intentionally not added (build-time helper only).
import MarkdownIt from 'markdown-it'
const md = new MarkdownIt({ html: true })
md.disable('code')
/** Render a markdown string to HTML. */
export function renderMarkdown(src: string): string {
return md.render(src)
}