Updated version of John Resig's htmlparser.js - read blog post
Which was based on Erik Arvidsson's simplehtmlparser.js
toDOM()
removed, was not neededthis
context corrected for WScriptthrow Error()
to work for WScripttoXMLString
can pass intag()
,attr()
makeMap
will also make uppercase versions
var xmlString = HTMLParser.toXMLString(htmlString)
or
var xmlString = HTMLParser.toXMLString(
htmlString,
function(tag) {
return tag.toLowerCase()
},
function(attr) {
attr.escaped = attr.escaped.replace(/&/g, '&')
return attr
}
)