module watt.text.html
Functions for escaping and unescaping HTML.
Code Map
//! Functions for escaping and unescaping HTML.
module watt.text.html;
//! Get the HTML escaped version of a given string.
fn htmlEscape(str: string) string { }
//! Given an HTML escaped string str, unescape that string.
fn htmlUnescape(str: string) string { }
//! Writes the HTML escaped version of a given string to the given dgt.
fn htmlEscape(dgt: scope (Sink), str: string, ignore: string) { }
//! Returns the HTML escaped version of a given string, ignoring any HTML
//! tags.
fn htmlEscapeIgnoreTags(str: string) string { }
//! Writes the HTML escaped version of a given string to the given dgt,
//! ignoring any HTML tags.
fn htmlEscapeIgnoreTags(dgt: scope (Sink), str: string) { }
//! Escape every single character.
fn htmlEscapeAll(str: string) string { }
//! Escape every single character into a Sink.
fn htmlEscapeAll(dgt: scope (Sink), str: string) { }
fn htmlEscape(str: string) string
Get the HTML escaped version of a given string.
Example
htmlEscape(`"richard & friends"`); // ""richard & friends""
fn htmlUnescape(str: string) string
Given an HTML escaped string str
, unescape that string.
Example
htmlUnescape(""hello world""); // Returns "hello world"
fn htmlEscape(dgt: scope (Sink), str: string, ignore: string)
Writes the HTML escaped version of a given string to the given dgt.
fn htmlEscapeIgnoreTags(str: string) string
Returns the HTML escaped version of a given string, ignoring any HTML tags.
fn htmlEscapeIgnoreTags(dgt: scope (Sink), str: string)
Writes the HTML escaped version of a given string to the given dgt, ignoring any HTML tags.
fn htmlEscapeAll(str: string) string
Escape every single character.
fn htmlEscapeAll(dgt: scope (Sink), str: string)
Escape every single character into a Sink
.