/html-to-vdom

Converts an HTML string into a virtual DOM

Primary LanguageJavaScript

html-to-vdom Build Status

About

This is yet another library to convert HTML into a vtree. It's used in conjunction with virtual-dom to convert template based views into virtual-dom views.

Usage

var convertHTML = require('html-to-vdom');
var html = '<div>Foobar</div>';

convertHTML(html).then(function (vTree) { 
    // do something with your tree
    var createElement = require('virtual-dom/create-element');
    var el = createElement(vTree);
    document.body.appendChild(el);
});