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

fix: place preferred char in space token #295

Merged
merged 1 commit into from Sep 10, 2023

Conversation

idoros
Copy link
Collaborator

@idoros idoros commented Sep 7, 2023

This PR fixes #122 that claims that \r\n takes just the \r into the space token value.

The case is a little different. The space token takes only a single char into the value and breaks the rest of the whitespace to before and after. It used to search for normal space, and fallback to the first character. Now it looks for normal space and falls back to \n and then \t and only then picks the first character.

This is done presumably to help code formatting, but seems unnecessary to me. I change this in order to close the issue, but would prefer removing he before and `after altogether at some point.

@idoros idoros added bug Something isn't working css-value-parser labels Sep 7, 2023
@idoros idoros requested a review from barak007 September 7, 2023 11:55
@idoros idoros self-assigned this Sep 7, 2023
@idoros idoros merged commit c3e8bb9 into master Sep 10, 2023
6 checks passed
@idoros idoros deleted the ido/prefer-some-whitespace-over-another branch September 10, 2023 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working css-value-parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

css-value-parser does not parse spaces correctly
1 participant