The goog.string.html.HtmlSanitizer Class

goog.string.html.HtmlSanitizer
> goog.string.html.HtmlSaxHandler

goog.string.html.HtmlSanitizer(stringBuffer, opt_urlPolicy, opt_nmTokenPolicy)

An implementation of the {@code goog.string.HtmlSaxHandler} interface that will take each of the html tags and sanitize it.

stringBuffer {goog.string.StringBuffer}
A string buffer, used to output the html as we sanitize it.
opt_urlPolicy {?function(string):string}
An optional function to be applied in URLs.
opt_nmTokenPolicy {?function(string):string}
An optional function to be applied in names.

The goog.string.html.HtmlSanitizer.AttributeType Enum

The HTML types the parser supports. … more

.Attributes

A map of attributes to types it has.

@enum
{number}

.cdata(text)

Handler called when CDATA is found.

text {string}
The CDATA text found.

.endDoc()

Handler called when the parsing is done.

.endTag(name)

Handler called when the parser found a closing tag.

name {string}
The name of the tag that is ending.

.pcdata(text)

Handler called when PCDATA is found.

text {string}
The PCDATA text found.

.rcdata(text)

Handler called when RCDATA is found.

text {string}
The RCDATA text found.

.startDoc()

Handler called when the parser is starting to parse the document.

.startTag(name, attributes)

Handler called when the parser found a new tag.

name {string}
The name of the tag that is starting.
attributes {Array.<string>}
The attributes of the tag.