GeoLeaf Core API - v3.0.0
    Preparing search index...

    Function sanitizeSvgContent

    • Parse and sanitize SVG content safely, removing scripts and event handlers.

      Parameters

      • svgContent: string | null | undefined

        The raw SVG string to sanitize. Null or undefined returns null.

      Returns SVGElement | null

      The sanitized SVGElement, or null if parsing fails or content is invalid.

      Strips script, foreignObject, on* handlers, and javascript: hrefs from external SVG content.