Documentation - v0.28.2
    Preparing search index...

    Variable htmlConst

    html: HtmlTagFn = ...

    Tagged template based HTML-to-entities parser function.

    Whitespace is handled like in real HTML: newlines and consecutive spaces are collapsed into a single space. Use <br> for line breaks and &nbsp; for multiple spaces.

    Also has static methods:

    • html.escape - escape a string to be safely used in HTML
    • html.unparse - add HTML formatting to the text given the plain text and entities contained in it
    // whitespace is collapsed, <br> for newlines
    html`
    <b>Hello</b>,
    <i>world</i>!
    `
    // => { text: 'Hello, world!' }

    thtml for a variant that preserves whitespace as-is