@federicocarboni/saxe
    Preparing search index...

    Function xmlEscape

    • Escapes a string by replacing each instance of XML markup characters by their predefined entity or decimal character reference, so that they are interpreted literally in text content or attributes.

      Each of the following characters is replaced by the corresponding sequence:

      • &&
      • <&lt;
      • >&gt;
      • '&apos;
      • "&quot;
      • \t&#9; (TAB)
      • \n&#10; (LF)
      • \r&#13; (CR)

      Parameters

      • s: string

        A string to be escaped as XML content.

      Returns string

      • Returns a new string where each XML markup character is replaced by their escape sequence.
      xmlEscape("<div>Fish & chips</div>");
      // "&lt;div&gt;Fish &amp; chips&lt;/div&gt;"