EU Parliament Monitor — API Documentation - v0.9.24
    Preparing search index...

    Function decodeHtmlEntities

    • Decode the 5 HTML entities produced by escapeHTML() back to plain text. Used when extracting text from our own generated HTML to obtain unescaped values.

      IMPORTANT: &amp; MUST be decoded last. Decoding it first would convert &amp;lt; to &lt; before the &lt;< replacement runs, causing double-decoding. The correct order is: decode all specific entities first, then decode &amp; as the final step.

      Parameters

      • str: string

        HTML string with entities

      Returns string

      Plain text with entities decoded