htmlToNode function

This commit is contained in:
Tony Garnock-Jones 2018-11-19 22:21:29 +00:00
parent 7267503337
commit 1c317f5134
1 changed files with 6 additions and 0 deletions

View File

@ -79,3 +79,9 @@ export function htmlToString(j) {
walk(j);
return pieces.join('');
}
export function htmlToNode(j) {
var node = document.createElement('div');
node.innerHTML = htmlToString(j);
return node.firstChild;
}