@umbraco-cms/backoffice
    Preparing search index...

    Function encodeHtmlEntities

    • Encode HTML special characters so they roundtrip safely through markdown. & is encoded first to avoid double-encoding the ampersand in other entities (e.g. <&lt;, not &amp;lt;).

      Note: " is intentionally NOT encoded here because double quotes are ordinary characters in markdown and do not need escaping. The decode function still handles &quot; because the markdown tokenizer may emit it.

      Parameters

      • text: string

      Returns string