Skip to content

fix: tokenize multiplication in nested calc parentheses - #102

Open
DeepanshuPal wants to merge 2 commits into
postcss:mainfrom
DeepanshuPal:fix/nested-calc-multiplication
Open

DeepanshuPal wants to merge 2 commits into
postcss:mainfrom
DeepanshuPal:fix/nested-calc-multiplication

Conversation

@DeepanshuPal

Copy link
Copy Markdown

Fixes #86.

Inside anonymous parentheses under calc(), multiplication without spaces was left inside a word token. For calc((-1*var(--a))), that also made -1*var look like a function name. Keep the calc context for anonymous parentheses, split the * token there, and leave nested named functions such as var() unchanged.

Added AST regressions for both reported examples and the nested var() boundary. Validation: pnpm test (169 passed), pnpm lint, pnpm exec oxfmt --check lib/parse.js test/parse.js, and git diff --check.

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

Successfully merging this pull request may close these issues.

Incorrect parsing of calc operations without spaces in parentheses

1 participant