Commit 31d71de
committed
Ensure void and self-closing elements pop from stack when advancing.
Previously, the logic to pop void and self-closing elements from the
stack of open elements only ran when stepping into the next node in
a document. With the introduction of `next_token()` there appeared a
new way to reprocesses the current token, so this logic would be skipped
when calling `next_token()` _into_ a void or self-closing element,
leaving it on the stack.
In this patch the logic runs whenever the processor is not reprocessing
the current token. A new class constant communicates that `step()`
should treat the current token as if it arrived there itself, that is,
to process it with the normal rules but without advancing the parser.1 parent 7890b53 commit 31d71de
1 file changed
+13
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
434 | | - | |
| 434 | + | |
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
| |||
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
516 | | - | |
| 516 | + | |
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
| |||
532 | 532 | | |
533 | 533 | | |
534 | 534 | | |
| 535 | + | |
535 | 536 | | |
| 537 | + | |
536 | 538 | | |
537 | 539 | | |
538 | 540 | | |
| |||
1781 | 1783 | | |
1782 | 1784 | | |
1783 | 1785 | | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
1784 | 1795 | | |
1785 | 1796 | | |
1786 | 1797 | | |
| |||
0 commit comments