fulan-editor
Version:
An open source react editor based on draft-Js and ant design, good support HTML, markdown and Draft Raw format.
17 lines (16 loc) • 420 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = parseHTML;
function parseHTML(html) {
var doc = void 0;
if (typeof DOMParser !== 'undefined') {
var parser = new DOMParser();
doc = parser.parseFromString(html, 'text/html');
} else {
doc = document.implementation.createHTMLDocument('');
doc.documentElement.innerHTML = html;
}
return doc.body;
}