The goog.string.html Namespace

The goog.string.html.HtmlParser Class

An Html parser: {@code parse} takes a string and calls methods on {@code goog.string.html.HtmlSaxHandler} while it is visiting it. … more

The goog.string.html.HtmlSanitizer Class

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

The goog.string.html.HtmlSaxHandler Class

An interface to the {@code goog.string.html.HtmlParser} visitor, that gets called while the HTML is being parsed. … more

.htmlSanitize(htmlText, opt_urlPolicy, opt_nmTokenPolicy)

Strips unsafe tags and attributes from HTML.

htmlText {string}
The HTML text to sanitize.
opt_urlPolicy {function(string) : string}
A transform to apply to URL attribute values.
opt_nmTokenPolicy {function(string) : string}
A transform to apply to names, IDs, and classes.
returns {string}
A sanitized HTML, safe to be embedded on the page.

.toLowerCase(str)

TODO(goto): why isn't this in the string package ? does this solves any real problem ? move it to the goog.string package if it does.

str {string}
The string to lower case.
returns {string}
The str in lower case format.