tagser 1.0.0
tagser: ^1.0.0 copied to clipboard
A starting point for Dart libraries or applications.
Overview #
A library for Dart developers.
Simple tag-based document parser. It is not about HTML parsing. You can use whatever tags you want.
Available types of tags:
- Self closing tags: <tag [attributes]/>
- Block tags: <tag [attributes]> Body
Attributes types:
- bool:
- with value:
Usage #
A simple usage example:
import 'package:tagser/tagser.dart';
main() {
var tagser = new Tagser();
var html = '<hello> Hello bro </hello>';
var list = tagser.parse(html);
}
Notes #
- Tag names are case sensitive. Open and close tags in block tag declaration should have the same spelling
- Attribute names are case sensitive: attribute
Aand attributeaare not the same
Restrictions #
- All self closing tags should have slash before closing bracket. Using
<br>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 :
<tag / >- will cause an error - No spaces allowed in attribute declaration:
<tag A = 'value'/> - error<tag A= 'value'/> - error<tag A ='value'/> - error