Skip to content

[css-syntax-3] The + in <an+b> confuses parsing tools #9473

Description

@tidoust

The <an+b> type is defined with a production rule that starts with <an+b> = .... This type is now referenced from the definition of :nth() in the CSS Generated Content for Paged Media Module.

Problem is that the + confuses grammar parsers, including CSSTree and the highlighting mechanism in Bikeshed (which creates a link to the definition of +), as they parse + as a component value multiplier.

The Value Syntax Definition is not entirely clear about what characters can be used to define basic data types between < and > but it says:

Other non-keyword literal characters that may appear in a component value, such as “+”, must be written enclosed in single quotes.

I think that's the only occurrence in CSS specs of a construct that parsers find problematic. Tools could be fixed of course, I'm wondering whether it would be ok to defined the type as <an-plus-b> instead.

(If so, I'm happy to prepare a PR to update the specs that define or reference the type)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions