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

CSS property setting syntax does not permit the use of a colon (:) in the assigned value. #3886

Open
dbolack-ab opened this issue Nov 10, 2024 · 5 comments

Comments

@dbolack-ab
Copy link
Collaborator

Renderer

v3

Browser

Chrome

Operating System

Windows

What happened?

In writing a how-to I discovered I was unable to assign a string value to a CSS property if it contained a : via the {{}} style setting syntax.

Code

{{footer,--chapterName:"'1:How-to'"}}

Generates

<span class="inline-block footer" style="--chapterName:;">“‘1:How-to’”</span>

Instead of

<span class="inline-block footer" style="--chapterName:‘1:How-to’;”></span>
@dbolack-ab
Copy link
Collaborator Author

The semi-colon is also superfluous.

@5e-Cleric
Copy link
Member

5e-Cleric commented Nov 10, 2024

Right, we need to encode as a CSS string: https://developer.mozilla.org/en-US/docs/Web/CSS/string

@5e-Cleric
Copy link
Member

5e-Cleric commented Nov 10, 2024

This also applies to html attributes.

@dbolack-ab
Copy link
Collaborator Author

Right, we need to encode as a CSS string: https://developer.mozilla.org/en-US/docs/Web/CSS/string

I am unable to discern how my examples fail here?

@ericscheid
Copy link
Collaborator

(The semicolon being inserted here is expected as a separator of multiple style rules.)

The bug here is in our parsing rules .. the colon is confusing our regex. Similar things happen with an equals =.

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

3 participants