EU Parliament Monitor — API Documentation - v1.0.11
    Preparing search index...

    Function sanitizeMermaidQuadrantChart

    • Auto-quote unquoted quadrantChart labels so the Mermaid v11 lexer accepts them. The Mermaid quadrantChart grammar treats unquoted labels as a restricted token class — em-dashes (, U+2014), en-dashes (, U+2013), ellipsis (), parentheses, colons, and non-ASCII currency symbols () all trigger Lexical error … Unrecognized text and prevent the diagram from rendering. Sanitization is scoped to quadrantChart blocks only; other diagram types accept those characters in unquoted labels and are passed through unchanged.

      Parameters

      • content: string

        Raw mermaid fence body

      Returns string

      The same content with quadrantChart labels auto-quoted; the input string is returned unchanged for non-quadrant diagrams or when no edits are required.