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

Nested elements with attributes containing commas injects parent selector #2658

Open
IdkGoodName opened this issue Feb 8, 2022 · 0 comments
Assignees

Comments

@IdkGoodName
Copy link

I haven't really found any issue related to this, so I am sorry if it already has been submitted, but it's just something that I discovered while using Stylus for one of my projects.

When you have a selector and nest a child to it containing an attribute with a value containing comma, Stylus injects the parent selector after the comma.

To reproduce:

.a
    &[b="c, d"]
        color: red

Current behavior:

The parent selector gets injected after the comma in the attribute's value.
Output from the "To reproduce" section:

.a[b="c,.a d"] {
    color: red;
}

Expected behavior:

The attribute's value not getting touched at all, even the whitespace after the comma not being removed. Expected output:

.a[b="c, d"] {
    color: red;
}

Environment information:

  • stylus version: 0.56.0
  • nodejs version: 17.3.0
@iChenLei iChenLei self-assigned this Feb 9, 2022
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

2 participants