GeoLeaf Core API - v3.19.0
    Preparing search index...
    • Escape dangerous HTML characters to prevent XSS.

      Parameters

      • str: string | null | undefined

        The string to escape. Null or undefined returns "".

      Returns string

      The HTML-escaped string, safe for use in DOM text contexts.

      Escapes &, <, > via a text node's HTML serialization — safe for HTML TEXT / element-content contexts. It does NOT escape the quotes " and '; for an attribute-value context use escapeAttribute, which escapes all five. (An earlier version of this line claimed the quotes were escaped — they are not.)