HtmlUtils

TheArtOfDev.HtmlRenderer.Core.Utils

Constructors

HtmlUtils()

Init.

Methods

DecodeHtml(string) : string

Decode html encoded string to regular string. Handles <, >, "&.

str
the string to decode

Returns: decoded string

DecodeHtmlCharByCode(string) : string

Decode html special charecters encoded using char entity code (€)

str
the string to decode

Returns: decoded string

DecodeHtmlCharByName(string) : string

Decode html special charecters encoded using char entity name (&#euro;)

str
the string to decode

Returns: decoded string

EncodeHtml(string) : string

Encode regular string into html encoded string. Handles <, >, "&.

str
the string to encode

Returns: encoded string

IsSingleTag(string) : bool

Is the given html tag is single tag or can have content.

tagName
the tag to check (must be lower case)

Returns: true - is single tag, false - otherwise

Fields

_decodeOnly : Dictionary<string, char>

the html decode only pairs

_encodeDecode : KeyValuePair<string, string>[]

the html encode\decode pairs

_list : List<string>

List of html tags that don't have content