An open API service indexing awesome lists of open source software.

https://github.com/gitbookio/html2hs

Convert HTML to hyperscript for virtual-dom
https://github.com/gitbookio/html2hs

Last synced: 3 months ago
JSON representation

Convert HTML to hyperscript for virtual-dom

Awesome Lists containing this project

README

          

# html2hs

[![NPM version](https://badge.fury.io/js/html2hs.svg)](http://badge.fury.io/js/html2hs) [![Build Status](https://travis-ci.org/GitbookIO/html2hs.svg?branch=master)](https://travis-ci.org/GitbookIO/html2hs)

Parse HTML to [hyperscript](https://github.com/Matt-Esch/virtual-dom/tree/master/virtual-hyperscript) (for [virtual-dom](https://github.com/Matt-Esch/virtual-dom)).

``` js
var html2hs = require('html2hs');

var hscript = html2hs('

Hello World

');

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

`html2hs` also accept an option argument:

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