Extract the innerText from a snippet of HTML
npm install innertextExtract the innerText from a snippet of HTML



``sh`
npm install innertext
Pass it a string containing some HTML.
`js
var innertext = require('innertext');
var text = innertext('
console.log(text); // 'Heading text with some markup'
`
The current implementation favors speed and simplicity over other considerations
like perfect web browser compatibility. For instance:
* malformed HTML (e.g., un-encoded < & > characters, etc…)
will generally break the text extraction process
* whitespace around HTML tag/element boundaries gets collapsed into a single
space, whereas browsers will typically preserve newlines
So if you trust the incoming HTML, things will typically be OK, but don't use
this as the basis for creating a browser or anything.
`sh``
npm install
npm test
ISC