Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: support parsing */ expressions without surrounding spaces #144

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

Merged
shellscape merged 1 commit into shellscape:master from cyjake:fix-138
Jan 7, 2022

Conversation

@cyjake
Copy link
Contributor

@cyjake cyjake commented Nov 22, 2021

fixes #138

This PR contains:

  • bugfix
  • feature
  • refactor
  • tests
  • documentation
  • metadata

Breaking Changes?

  • yes
  • no

If yes, please describe the breakage.

Please Describe Your Changes

The tokens returned by postcss does not split chunk like *var, which causes expressions that containing * or / operations without surrounding spaces to break. This PR checks the value before letting them go through Func, and tokenize further with Operator instead, therefore fixes the issue.

  • / is tricky to determine because url(/foo/bar.jpg) is totally legit as well. Is there any means that can be used to determine current context is truly an expression in calc()?

entretechno-jeremiah reacted with heart emoji
Copy link
Contributor Author

cyjake commented Nov 22, 2021
edited
Loading

(削除) If calc() context cannot be determined, I think a partial fix that handles * without surrounding spaces still suffices a PR (削除ここまで). Context checked with this.lastNode.type === 'func'

@cyjake cyjake changed the title (削除) [wip] fix: support parsing */ expressions without surrounding spaces (削除ここまで) (追記) fix: support parsing */ expressions without surrounding spaces (追記ここまで) Nov 23, 2021
Copy link
Contributor Author

cyjake commented Nov 23, 2021

@shellscape pr is ready now :-)

@shellscape shellscape merged commit b143c3a into shellscape:master Jan 7, 2022
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Cannot parse calculations without spaces around the * operator

AltStyle によって変換されたページ (->オリジナル) /