mirror of
https://github.com/danbulant/node-html-parser
synced 2026-06-18 22:21:24 +00:00
format
This commit is contained in:
parent
6a7ea254af
commit
130245e09c
1 changed files with 3 additions and 3 deletions
|
|
@ -628,8 +628,9 @@ export function parse(data: string, options = {} as Options) {
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (options.lowerCaseTagName)
|
if (options.lowerCaseTagName) {
|
||||||
match[2] = match[2].toLowerCase();
|
match[2] = match[2].toLowerCase();
|
||||||
|
}
|
||||||
if (!match[1]) {
|
if (!match[1]) {
|
||||||
// not </ tags
|
// not </ tags
|
||||||
const attrs = {};
|
const attrs = {};
|
||||||
|
|
@ -677,8 +678,7 @@ export function parse(data: string, options = {} as Options) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (match[1] || match[4] ||
|
if (match[1] || match[4] || kSelfClosingElements[match[2]]) {
|
||||||
kSelfClosingElements[match[2]]) {
|
|
||||||
// </ or /> or <br> etc.
|
// </ or /> or <br> etc.
|
||||||
while (true) {
|
while (true) {
|
||||||
if (currentParent.tagName === match[2]) {
|
if (currentParent.tagName === match[2]) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue