Skip to content

Commit

Permalink
refactor(parser): Invert event processing (inikulin#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
fb55 authored and jmbpwtw committed Feb 16, 2023
1 parent 7505d87 commit 5e51d31
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
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

0 comments on commit 5e51d31

Please sign in to comment.