Simple tag-based document parser.
npm install tagser4jsSimple tag-based document parser. It is not about HTML parsing. You can use whatever tags you want.
Available types of tags:
- Self closing tags:
- Block tags:
Attributes types:
- bool: bordered='true'
- with value:
A simple usage example:
``javascript
const Tagser = require('tagser4js');
var tagser = new Tagser();
var html = '
var list = tagser.parse(html);
}
`
- Tag names are case sensitive. Open and close tags in block tag declaration should have the same spelling
- Attribute names are case sensitive: attribute A and attribute a are not the same
tag without slash will cause an error.
- No spaces allowed between open bracket and tag name: < tag /> - will cause an error
- No spaces allowed between slash and close bracket : - will cause an error
- No spaces allowed in attribute declaration:
- You can pass options to the Tagser constructor or set them with setOption() method.
Available options:
- ignoreCase - enables or disables case ignoring of opening and closing tag; false` by default