Skip to content

BadString recovery issues #393

Open
Open
@xmo-odoo

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions