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

BadString recovery issues #393

Open
xmo-odoo opened this issue Oct 28, 2024 · 0 comments
Open

BadString recovery issues #393

xmo-odoo opened this issue Oct 28, 2024 · 0 comments

Comments

@xmo-odoo
Copy link

According to CSS forward-compatible parsing rules, if a CSS declaration fails to parse the parser should forward until whichever is closer of EOF and a semicolon then resume parsing.

cssparser doesn't seem to allow for this when trying to parse a "bad string" containing a newline e.g.

text-decoration: '\n'; color: green

Once the parser has triggered a BadString error, the next token is

    QuotedString(
        "; color: green",
    ),

This is not the behaviour of browsers e.g. if this is added as a style value to an element in firefox, the text-decoration is flagged as an invalid property value, and the color declaration is parsed properly and applied.

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