While Wyam is certainly still usable, it's been rebranded and rebooted as Statiq with a ton of improvements. You almost certainly want to look there unless you're already a Wyam user.

HtmlEscape Wyam.Html

Automatically escapes HTML content.


This module exists in the Wyam.Html package which is not part of the core distribution. Add the following preprocessor directive to your configuration file to use it:
#n Wyam.Html


  • HtmlEscape()

    Escapes HTML content with predefined escape sequences.

Fluent Methods

Chain these methods together after the constructor to modify behavior.

  • EscapeAllNonstandard()

    Escapes all nonstandard characters (standard characters are defined with the WithDefaultStandard() or WithStandard() methods).

  • WithDefaultStandard()

    Defines a standard set of characters as 0-9, a-z, A-Z, newlines, and space. Use with the EscapeAllNonstandard() method to whitelist this default set of characters.

  • WithEscapedChar(params char[] toEscape)

    Defines additional characters to escape.

    • toEscape

      The additional characters to escape.

  • WithStandard(params char[] standard)

    Defines a custom set of standard characters to use with the EscapeAllNonstandard() method.

    • standard

      The standard set of characters to use.