errisy-parser
v1.0.0
Published
This is an dom independent html parser.
Downloads
2
Readme
Errisy-Parser
This is an dom independent html parser.
Parse html without dom
When you use dom to parse html, dom may change the letter case of html tags and attributes. But many frameworks such as Angular are case-sensitive. So dom parsed html may not work properly in js frameworks.
Totally written in regular expression, no other dependencies.
This is a clean and powerful parser, which does not reply on any other dependencies.
Usage
let parsedHTML = HTMLParser.parse(html);
// then you can use parsedHTML to search elements. element data structure can be found in the interface definitions.
export interface IHTMLNode {
start: number;
end: number;
tag: string;
attributes: IHTMLAttribute[];
nodes: IHTMLNode[];
}
export interface IHTMLAttribute {
start: number;
end: number;
key: string;
value: string;
}