Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(parser): Invert event processing #405

Merged
merged 13 commits into from
Feb 27, 2022
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 @@ -64,13 +64,13 @@ export class ParserFeedbackSimulator {
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