Parse a string of HTML or XML (including MathML, SVG, XHTML) into a document object.
Uses the HTML template element in browsers and jsdom in Node.js.
import { parse } from 'dom-parse';
parse(string);
string
String containing HTML or XML to parse.
DocumentFragment
Object containing Node structure of HTML/XML parsed.
import { parse } from 'dom-parse';
parse('Some <em>awesome</em> markup <img src="explosion.gif">');
// returns DocumentFragment(4) [ #text, em, #text, img ]