Astlide API Reference
    Preparing search index...
    • Sanitize KaTeX-generated HTML output. Meant for KaTeX's own output only (rendered with trust: false): it is a denylist, not a general sanitizer — use sanitizeHTML for other HTML.

      Lighter than sanitizeHTML — preserves SVG elements and inline styles required for correct math rendering while removing injection vectors:

      1. <script>, and elements KaTeX never emits that can run or load content or change how the page parses (iframe, object, embed, noscript, style, meta, base, form, SVG animate / set …)
      2. on* event-handler attributes, srcdoc, and SVG animation values (values / to / from / by)
      3. javascript:/vbscript:/data: URLs in href/src/xlink:href/action/formaction

      Works on a parsed tree, not regexes, so odd spellings (</script >, <ScRiPt>, entities in URLs) can't slip through. Entities and markup are otherwise written back as they were.

      Parameters

      • html: string

      Returns string