All files / markdown / presets / web.ts

100.00% Branches 0/0
100.00% Lines 7/7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 
x1
x1
x1
 
 
x5
 
 
 
 
x1
x4
x4











// Imports
import { Renderer } from "../renderer.ts"
import gfm from "../plugins/gfm.ts"
import highlighting from "../plugins/highlighting.ts"

/** Renderer instance. */
const renderer = new Renderer({ plugins: [gfm, highlighting] })

/**
 * Renders a markdown expression suitable for web pages (including untrusted HTML).
 */
export function markdown(text: string): Promise<string> {
  return renderer.render(text)
}