C# Class HtmlKit.HtmlUtils

A collection of HTML-related utility methods.
A collection of HTML-related utility methods.
Datei anzeigen Open project: prepare/HTML-Renderer

Public Methods

Method Description
HtmlAttributeEncode ( char value, int startIndex, int count, char quote = '"' ) : string

Encode an HTML attribute value.

Encodes an HTML attribute value.

HtmlAttributeEncode ( string value, char quote = '"' ) : string

Encode an HTML attribute value.

Encodes an HTML attribute value.

HtmlAttributeEncode ( string value, int startIndex, int count, char quote = '"' ) : string

Encode an HTML attribute value.

Encodes an HTML attribute value.

HtmlAttributeEncode ( TextWriter output, char value, int startIndex, int count, char quote = '"' ) : void

Encode an HTML attribute value.

Encodes an HTML attribute value.

HtmlAttributeEncode ( TextWriter output, string value, char quote = '"' ) : void

Encode an HTML attribute value.

Encodes an HTML attribute value.

HtmlAttributeEncode ( TextWriter output, string value, int startIndex, int count, char quote = '"' ) : void

Encode an HTML attribute value.

Encodes an HTML attribute value.

HtmlDecode ( string data ) : string

Decode HTML character data.

Decodes HTML character data.

HtmlDecode ( string data, int startIndex, int count ) : string

Decode HTML character data.

Decodes HTML character data.

HtmlDecode ( TextWriter output, string data ) : void

Decode HTML character data.

Decodes HTML character data.

HtmlDecode ( TextWriter output, string data, int startIndex, int count ) : void

Decode HTML character data.

Decodes HTML character data.

HtmlEncode ( char data, int startIndex, int count ) : string

Encode HTML character data.

Encodes HTML character data.

HtmlEncode ( string data ) : string

Encode HTML character data.

Encodes HTML character data.

HtmlEncode ( string data, int startIndex, int count ) : string

Encode HTML character data.

Encodes HTML character data.

HtmlEncode ( TextWriter output, char data, int startIndex, int count ) : void

Encode HTML character data.

Encodes HTML character data.

HtmlEncode ( TextWriter output, string data ) : void

Encode HTML character data.

Encodes HTML character data.

HtmlEncode ( TextWriter output, string data, int startIndex, int count ) : void

Encode HTML character data.

Encodes HTML character data.

Private Methods

Method Description
HtmlAttributeEncode ( TextWriter output, ICharArray value, int startIndex, int count, char quote = '"' ) : void
HtmlEncode ( TextWriter output, ICharArray data, int startIndex, int count ) : void
IndexOfHtmlEncodeAttributeChar ( ICharArray value, int startIndex, int endIndex, char quote ) : int
IndexOfHtmlEncodeChar ( ICharArray value, int startIndex, int endIndex ) : int
IsValidTokenName ( string name ) : bool

Method Details

HtmlAttributeEncode() public static method

Encode an HTML attribute value.
Encodes an HTML attribute value.
/// is null. /// /// and do not specify /// a valid range in the value. /// /// is not a valid quote character. ///
public static HtmlAttributeEncode ( char value, int startIndex, int count, char quote = '"' ) : string
value char The attribute value to encode.
startIndex int The starting index of the attribute value.
count int The number of characters in the attribute value.
quote char The character to use for quoting the attribute value.
return string

HtmlAttributeEncode() public static method

Encode an HTML attribute value.
Encodes an HTML attribute value.
/// is null. /// /// is not a valid quote character. ///
public static HtmlAttributeEncode ( string value, char quote = '"' ) : string
value string The attribute value to encode.
quote char The character to use for quoting the attribute value.
return string

HtmlAttributeEncode() public static method

Encode an HTML attribute value.
Encodes an HTML attribute value.
/// is null. /// /// and do not specify /// a valid range in the value. /// /// is not a valid quote character. ///
public static HtmlAttributeEncode ( string value, int startIndex, int count, char quote = '"' ) : string
value string The attribute value to encode.
startIndex int The starting index of the attribute value.
count int The number of characters in the attribute value.
quote char The character to use for quoting the attribute value.
return string

HtmlAttributeEncode() public static method

Encode an HTML attribute value.
Encodes an HTML attribute value.
/// is null. /// -or- /// is null. /// /// and do not specify /// a valid range in the value. /// /// is not a valid quote character. ///
public static HtmlAttributeEncode ( TextWriter output, char value, int startIndex, int count, char quote = '"' ) : void
output System.IO.TextWriter The to output the result.
value char The attribute value to encode.
startIndex int The starting index of the attribute value.
count int The number of characters in the attribute value.
quote char The character to use for quoting the attribute value.
return void

HtmlAttributeEncode() public static method

Encode an HTML attribute value.
Encodes an HTML attribute value.
/// is null. /// -or- /// is null. /// /// is not a valid quote character. ///
public static HtmlAttributeEncode ( TextWriter output, string value, char quote = '"' ) : void
output System.IO.TextWriter The to output the result.
value string The attribute value to encode.
quote char The character to use for quoting the attribute value.
return void

HtmlAttributeEncode() public static method

Encode an HTML attribute value.
Encodes an HTML attribute value.
/// is null. /// -or- /// is null. /// /// and do not specify /// a valid range in the value. /// /// is not a valid quote character. ///
public static HtmlAttributeEncode ( TextWriter output, string value, int startIndex, int count, char quote = '"' ) : void
output System.IO.TextWriter The to output the result.
value string The attribute value to encode.
startIndex int The starting index of the attribute value.
count int The number of characters in the attribute value.
quote char The character to use for quoting the attribute value.
return void

HtmlDecode() public static method

Decode HTML character data.
Decodes HTML character data.
/// is null. ///
public static HtmlDecode ( string data ) : string
data string The character data to decode.
return string

HtmlDecode() public static method

Decode HTML character data.
Decodes HTML character data.
/// is null. /// /// and do not specify /// a valid range in the data. ///
public static HtmlDecode ( string data, int startIndex, int count ) : string
data string The character data to decode.
startIndex int The starting index of the character data.
count int The number of characters in the data.
return string

HtmlDecode() public static method

Decode HTML character data.
Decodes HTML character data.
/// is null. /// -or- /// is null. ///
public static HtmlDecode ( TextWriter output, string data ) : void
output System.IO.TextWriter The to output the result.
data string The character data to decode.
return void

HtmlDecode() public static method

Decode HTML character data.
Decodes HTML character data.
/// is null. /// -or- /// is null. /// /// and do not specify /// a valid range in the data. ///
public static HtmlDecode ( TextWriter output, string data, int startIndex, int count ) : void
output System.IO.TextWriter The to output the result.
data string The character data to decode.
startIndex int The starting index of the character data.
count int The number of characters in the data.
return void

HtmlEncode() public static method

Encode HTML character data.
Encodes HTML character data.
/// is null. /// /// and do not specify /// a valid range in the data. ///
public static HtmlEncode ( char data, int startIndex, int count ) : string
data char The character data to encode.
startIndex int The starting index of the character data.
count int The number of characters in the data.
return string

HtmlEncode() public static method

Encode HTML character data.
Encodes HTML character data.
/// is null. ///
public static HtmlEncode ( string data ) : string
data string The character data to encode.
return string

HtmlEncode() public static method

Encode HTML character data.
Encodes HTML character data.
/// is null. /// /// and do not specify /// a valid range in the data. ///
public static HtmlEncode ( string data, int startIndex, int count ) : string
data string The character data to encode.
startIndex int The starting index of the character data.
count int The number of characters in the data.
return string

HtmlEncode() public static method

Encode HTML character data.
Encodes HTML character data.
/// is null. /// -or- /// is null. /// /// and do not specify /// a valid range in the data. ///
public static HtmlEncode ( TextWriter output, char data, int startIndex, int count ) : void
output System.IO.TextWriter The to output the result.
data char The character data to encode.
startIndex int The starting index of the character data.
count int The number of characters in the data.
return void

HtmlEncode() public static method

Encode HTML character data.
Encodes HTML character data.
/// is null. /// -or- /// is null. ///
public static HtmlEncode ( TextWriter output, string data ) : void
output System.IO.TextWriter The to output the result.
data string The character data to encode.
return void

HtmlEncode() public static method

Encode HTML character data.
Encodes HTML character data.
/// is null. /// -or- /// is null. /// /// and do not specify /// a valid range in the data. ///
public static HtmlEncode ( TextWriter output, string data, int startIndex, int count ) : void
output System.IO.TextWriter The to output the result.
data string The character data to encode.
startIndex int The starting index of the character data.
count int The number of characters in the data.
return void