HtmlEscape Wyam.Html

Automatically escapes HTML content.

Package

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
Alternativly, you can add all modules at once with the following preprocessor directive:
#n Wyam.All

Usage

  • 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.

GitHub