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

Elements within <noscript> cannot be rewritten #206

Open
bglw opened this issue Feb 1, 2024 · 0 comments
Open

Elements within <noscript> cannot be rewritten #206

bglw opened this issue Feb 1, 2024 · 0 comments

Comments

@bglw
Copy link

bglw commented Feb 1, 2024

It looks like lol-html currently parses the <noscript> element as RawText, along with the usual candidates like <style> and <iframe>. That's the correct behavior when parsing/tokenizing HTML with the scripting flag enabled.

It begs a question whether lol-html should be pretending to have the scripting flag enabled or disabled. I could see arguments either way, and it would at least be a useful option to have. In the current state, it's impossible to rewrite these elements that will be shown for end users not running JavaScript.

I don't know if there would be any real ramifications to turning the scripting flag on — from what I can see it only affects tokenization/parsing of the <noscript> element. The main downside would be breaking/confusing the parser if the <noscript> contains garbage — but since it should contain HTML in the case where scripting is disabled, valid HTML should be a reasonable expectation here.

Originally posted by @bglw in #184 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant