html parser module
npm install html-parse-regex

Create tree object of html/xml raw file.
Each node have:
* tag name
* all params tag parsed to a js object
* link to inner tags
npm install npm install html-parse-regex
html
()
()
()
() ASCII links
`$3
`javascript
html {
list: [ / same object's but in list mode /
,
,
,
],
tree: {
root: true,
link: { / tree view mode /
childs: [ ] / object tag of div#A, base of this example /
}, / inner this you found link for children tags /
},
shortcut: {
id: { A: , B: } / link to tag object find by id /
}
error: {
forcedCloseTag: [ / if need close any tag open tag will appear in this error object /
{ tag: 'a', start: 5, end: 38 }
]
}
}
`$3
`javascript
/ TAG OBJECT /
= {
tag: "div",
attrs: { id: "A", align: "left", style: "margin-top:15px;" },
start: 0,
end: 123,
link: {
father: tree,
childs: [ ]
}
} = {
tag: "div",
attrs: { id: "B", class: "yttre" },
start: 0,
end: 123,
link: {
father: ,
childs: [ ]
}
}
/ PURE TEXT OBJECT /
= {
text: "ASCII links",
start: 20,
end: 31,
link: {
father:
}
}
`##To create tree from raw html/xml
Example:
`javascript
import fs from 'fs';
import parse from 'html-parse-regex';const htmlRaw = fs.readFileSync(
index.html, 'utf8');
const html = parse(htmlRaw);
``