Skip to content

Commit

Permalink
refactor(parser): Invert event processing (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
fb55 authored Feb 27, 2022
1 parent 722f429 commit 9d76f78
Show file tree
Hide file tree
Showing 4 changed files with 554 additions and 855 deletions.
4 changes: 2 additions & 2 deletions packages/parse5-sax-parser/lib/parser-feedback-simulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ export class ParserFeedbackSimulator implements TokenHandler {
private _enterNamespace(namespace: NS): void {
this.namespaceStack.unshift(namespace);
this.inForeignContent = namespace !== NS.HTML;
this.tokenizer.allowCDATA = this.inForeignContent;
this.tokenizer.inForeignNode = this.inForeignContent;
}

private _leaveCurrentNamespace(): void {
this.namespaceStack.shift();
this.inForeignContent = this.namespaceStack[0] !== NS.HTML;
this.tokenizer.allowCDATA = this.inForeignContent;
this.tokenizer.inForeignNode = this.inForeignContent;
}

//Token handlers
Expand Down
Loading

0 comments on commit 9d76f78

Please sign in to comment.