Skip to content

Commit

Permalink
fix: Do namespace check for every numbered header / table cell
Browse files Browse the repository at this point in the history
The parenthesis led to only the last element being checked.
  • Loading branch information
fb55 committed Jan 7, 2022
1 parent dee793b commit b4b5d4a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/parse5/lib/parser/open-element-stack.js
Expand Up @@ -148,12 +148,8 @@ export class OpenElementStack {
this.pop();

if (
tn === $.H1 ||
tn === $.H2 ||
tn === $.H3 ||
tn === $.H4 ||
tn === $.H5 ||
(tn === $.H6 && ns === NS.HTML)
(tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) &&
ns === NS.HTML
) {
break;
}
Expand All @@ -167,7 +163,7 @@ export class OpenElementStack {

this.pop();

if (tn === $.TD || (tn === $.TH && ns === NS.HTML)) {
if ((tn === $.TD || tn === $.TH) && ns === NS.HTML) {
break;
}
}
Expand Down

0 comments on commit b4b5d4a

Please sign in to comment.