/html2hs

Convert HTML to hyperscript for virtual-dom

Primary LanguageJavaScriptApache License 2.0Apache-2.0

html2hs

NPM version Build Status

Parse HTML to hyperscript (for virtual-dom).

var html2hs = require('html2hs');

var hscript = html2hs('<h1>Hello World</h1>');

// hscript = 'h("h1", [ "Hello World" ])'

html2hs also accept an option argument:

{
    // true: pre tags will be parsed like other tags
    pre: false
}