Skip to content
FutureBlitz

    Install

    Import std.text.encoding

    Html

    std.text.encoding

    struct

    Public Struct Html

    HTML's escaping, for text put in a page or an attribute's value.

    Examples

    Expect(Html.Escape("<b>\"Fish\" & chips") == "&lt;b&gt;&quot;Fish&quot; &amp; chips")
    Expect(Html.Unescape("&lt;3 &amp; &#x263A;") == "<3 & ☺")

    std/text/encoding.fb, line 444

    • Public Static Method Escape(text: String): String static method #

      text with "&", "<", ">", '"', and "'" as entities, so HTML shows it as it is.

    • Public Static Method Unescape(text: String): String static method #

      text with its entities as the characters they stand for: "&", "<", ">", """, "'", " ", and numbers like "é" and "é", one that isn't a Unicode scalar value as U+FFFD. Another "&" stays as it is.

    Report an issue with this page or with FutureBlitz on GitHub.