Module: infra-sk/modules/linkify


(static) escapeAndLinkify()

Given a string (usually given by an untrustworthy user), this returns a lit-html Part which contains the string contents with the following "improvements": * Any HTML is escaped ("<" and ">" become "<", ">", etc.). * URLs are wrapped in anchor tags. * Line breaks are replaced with
. * Bug shorthand (e.g. skia:1234) is wrapped in anchor tags. Example usage: html`user input: ${escapeAndLinkify(untrustedUserInput)}`;