Skip to content

Commit

Permalink
fix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mgambill committed Jan 3, 2025
1 parent eb6f478 commit 4307ad8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
```

```js
import { HtmlParser } from "@nmyvision/html-parser";

const hp = new HtmlParser();

let result = hp.Parse("<div><input disabled required type='text' /></div>");
let result = hp.parse("<div><input disabled required type='text' /></div>");
```

![Screenshot](docs/output-screenshot.png)
6 changes: 6 additions & 0 deletions src/HtmlParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4307ad8

Please sign in to comment.