GeoLeaf Core API - v3.0.0
    Preparing search index...
    • Parse HTML safely with a tag allowlist, converting disallowed elements to text nodes.

      Parameters

      • html: string

        The HTML string to parse. Non-string or empty values return an empty fragment.

      • allowedTags: string[] = DEFAULT_ALLOWED_TAGS

        Array of allowed tag names. Defaults to ["p","br","strong","em","span","a","ul","ol","li","b","i"].

      Returns DocumentFragment

      A DocumentFragment containing the sanitized DOM nodes.

      Parses untrusted HTML, keeping only whitelisted tags; validates link hrefs via validateUrl.