Skip to content

Commit bd7f0f7

Browse files
authored
ensure mode is always set to INITIAL during startTokenization (#119)
While currently, all branches set a mode, this is both subtle and fragile; if a branch ends up not setting mode it will never be reset. This means subsequent calls to start tokenisation can end up with a different initial mode. This change simply resets mode to INITIAL on every startTokenization() call, ensuring that if we ever miss it, it will be reset.
1 parent 8f7cfc3 commit bd7f0f7

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎src/nu/validator/htmlparser/impl/TreeBuilder.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ public boolean dropBufferIfLongerThan(int length) {
592592
templateModeStack = new int[64];
593593
listOfActiveFormattingElements = new StackNode[64];
594594
needToDropLF = false;
595+
mode = INITIAL;
595596
originalMode = INITIAL;
596597
templateModePtr = -1;
597598
stackNodesIdx = 0;

0 commit comments

Comments
 (0)