Const
Like html, but preserves whitespace as-is instead of collapsing it like HTML does.
This variant is fully compatible with the Bot API HTML syntax.
Leading indentation common to all lines is stripped (dedented), making it safe to use in indented code.
Also has static methods:
thtml.escape
thtml.unparse
html.unparse
// whitespace and newlines are preserved, common indent is strippedthtml` <b>Hello</b>, <i>world</i>!`// => { text: 'Hello,\nworld!' } Copy
// whitespace and newlines are preserved, common indent is strippedthtml` <b>Hello</b>, <i>world</i>!`// => { text: 'Hello,\nworld!' }
Like html, but preserves whitespace as-is instead of collapsing it like HTML does.
This variant is fully compatible with the Bot API HTML syntax.
Leading indentation common to all lines is stripped (dedented), making it safe to use in indented code.
Also has static methods:
thtml.escape- escape a string to be safely used in HTMLthtml.unparse- likehtml.unparse, but preserves whitespace in the output