`lossless: true` option does not preserve trailing spaces in selectors
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- css, javascript
Research direction
Start by running the issue's JavaScript reproduction through parser(...).process with lossless enabled, then trace the selector serialization path that handles the trailing space after the comma. Done means the reproduced selector retains that space and a regression test covers the expected output.
Written by the indexing model from the issue text.
Description
When using the loseless: true option trailing spaces are removed unexpectedly, even though should be preserved.
Related to https://github.com/stylelint/stylelint/pull/8074#discussion_r1817680694
Code to Reproduce
const parser = require('postcss-selector-parser');
const selector = ':not(a, )';
console.log('selector:', selector);
parser((selectors) => {
console.log('parsed:', selectors.toString());
})
.process(selector, { lossless: true })
Expected
selector: :not(a, )
parsed: :not(a, )
Actual
selector: :not(a, )
parsed: :not(a,)
- Dominant language
- JavaScript
- Stars
- 214
- Forks
- 63
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from postcss/postcss-selector-parser
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 74/100
-
postcss/postcss-selector-parser#332 · 1 reaction · 2 assignees ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
postcss/postcss-selector-parser#309 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
postcss/postcss-selector-parser#306 · 2 comments ·
All issues in postcss/postcss-selector-parser
Similar issues
-
bug confirmed issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
open-webui/open-webui#30750 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Mend: dependency security vulnerability untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 70/100