errisy-parser

1.0.0 • Public • Published

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;
    }

Readme

Keywords

Package Sidebar

Install

npm i errisy-parser

Weekly Downloads

1

Version

1.0.0

License

ISC

Last publish

Collaborators

  • errisy