MAIDR JavaScript API
    Preparing search index...
    • Escapes a string for use in a CSS selector.

      Uses the native CSS.escape when available (browsers), and falls back to a conservative escape for Node.js / SSR environments where CSS is undefined — jsdom included, which implements no CSS object at all.

      Parameters

      • value: string

        The raw string to escape.

      Returns string

      The escaped string, safe to embed in a CSS selector.