0.0.2 • Published 7 years ago

hsplit v0.0.2

Weekly downloads
11
License
-
Repository
github
Last release
7 years ago

hsplit

split html content using the headers tags

This library accept html input and give back a DOM node for the "article" element. If the article element does not exists, il will be created.

The content of article is splitted into sections using the html headers as separator.

This has been created to index html documents into the lunr search engine, because each header can have it's own url, the splitted elements can be indexed as separeted elements.

see hexo-generator-lunr.

Install

npm install --save hsplit

## Usage example

const hsplit = require('hsplit');

hsplit.document('<h2>Title</h2><p>Content</p>')
.then(article => {

});