diff --git a/README.md b/README.md index ff9076b..ea0fab0 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,11 @@ ``` ```js +import { HtmlParser } from "@nmyvision/html-parser"; + const hp = new HtmlParser(); -let result = hp.Parse("
"); +let result = hp.parse("
"); ``` ![Screenshot](docs/output-screenshot.png) diff --git a/src/HtmlParser.ts b/src/HtmlParser.ts index c624a4b..3c71765 100644 --- a/src/HtmlParser.ts +++ b/src/HtmlParser.ts @@ -34,6 +34,12 @@ export class HtmlParser { this.q = new StringQueue(); } + /** + * This function parses the html string and returns a list of nodes. + * + * @param source the html string to be parsed + * @returns HTMLNode[] + */ public parse(source: string): HtmlNode[] { this.source = source; this.q = new StringQueue(source);