An open API service indexing awesome lists of open source software.

https://github.com/netgusto/htmlparser-jresig

Javascript HTML Parser By John Resig (ejohn.org), wrapped as a Node.js module
https://github.com/netgusto/htmlparser-jresig

Last synced: 10 months ago
JSON representation

Javascript HTML Parser By John Resig (ejohn.org), wrapped as a Node.js module

Awesome Lists containing this project

README

          

# HTML Parser By John Resig (ejohn.org)

HTML Parser By John Resig (ejohn.org) wrapped as a Node.js module.

Original code by Erik Arvidsson, Mozilla Public License

// Use like so:
HTMLParser(htmlString, {
start: function(tag, attrs, unary) {},
end: function(tag) {},
chars: function(text) {},
comment: function(text) {}
});

// or to get an XML string:
HTMLtoXML(htmlString);

// or to get an XML DOM Document
HTMLtoDOM(htmlString);

// or to inject into an existing document/DOM node
HTMLtoDOM(htmlString, document);
HTMLtoDOM(htmlString, document.body);