All files / markdown / presets / svg.ts

100.00% Branches 0/0
100.00% Functions 1/1
100.00% Lines 5/5
1
2
3
4
5
6
7
8
9
10
11
12
 
x1
 
 
x1
 
 
 
 
x1
x3
x3










// Imports
import { Renderer } from "../renderer.ts"

/** Renderer instance. */
const renderer = new Renderer({ highlighting: true })

/**
 * Renders a markdown expression suitable for SVG (raw HTML is escaped so the output only contains markup generated by the renderer itself).
 */
export function markdown(text: string): string {
  return renderer.render(text)
}