Question: HTML string to vTree
davidworkman9 opened this issue · 2 comments
davidworkman9 commented
I'm wondering if there's a way I can seed the virtual-dom with a HTML string, without using eval. Below works, using dom2hscript
to parse an HTML string into a hyperscript string, then eval it with virtual-dom/h
in global scope, however using eval and polluting the global namespace are two things I'd like to avoid.
const lastOutput = eval(dom2hscript.parseHTML(html));
const el = createElement(lastOutput);
hallgren commented
I use vdom-parser to parse html strings into Vtree´s in Krumelur
davidworkman9 commented
@hallgren thanks that's exactly what I was looking for!