htmlToNode function
This commit is contained in:
parent
7267503337
commit
1c317f5134
|
@ -79,3 +79,9 @@ export function htmlToString(j) {
|
||||||
walk(j);
|
walk(j);
|
||||||
return pieces.join('');
|
return pieces.join('');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function htmlToNode(j) {
|
||||||
|
var node = document.createElement('div');
|
||||||
|
node.innerHTML = htmlToString(j);
|
||||||
|
return node.firstChild;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue