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
- Host: GitHub
- URL: https://github.com/gitbookio/html2hs
- Owner: GitbookIO
- License: apache-2.0
- Created: 2015-09-06T21:08:29.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-09-25T20:04:53.000Z (over 10 years ago)
- Last Synced: 2025-09-01T11:57:16.686Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 184 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# html2hs
[](http://badge.fury.io/js/html2hs) [](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
}
```