https://github.com/ecomfe/html-nest-rule
https://github.com/ecomfe/html-nest-rule
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ecomfe/html-nest-rule
- Owner: ecomfe
- Created: 2015-09-06T05:38:31.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2018-03-02T06:00:39.000Z (over 8 years ago)
- Last Synced: 2025-06-30T21:47:58.311Z (about 1 year ago)
- Language: JavaScript
- Size: 81.1 KB
- Stars: 8
- Watchers: 15
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
html-nest-rule
========
[](http://travis-ci.org/ecomfe/html-nest-rule)
[](https://www.npmjs.com/package/html-nest-rule)
[](https://coveralls.io/r/ecomfe/html-nest-rule)
[](https://david-dm.org/ecomfe/html-nest-rule)
[](https://david-dm.org/ecomfe/html-nest-rule)
html-nest-rule is nesting rule realization for [HTML spec](https://www.w3.org/TR/html5/Overview.html).
### Install
``` shell
npm i html-nest-rule
```
### Usage
```javascript
var element = document.createElement('p');
var rule = require('html-nest-rule').from(element);
rule.getCategories(element); // ['flow content', 'palpable content'], categories of given element
rule.validateContext(element); // [], do context validate
rule.validateContent(element); // [], do content validate
```