Skip to content

Conversation

@Poetro
Copy link
Contributor

@Poetro Poetro commented Dec 9, 2019

Follow-up to PR #112

Fix #114

The parenthesis matching was not checking the right balance before.
For the declaration value var(--box-shadow, 0px 2px 8px 0px rgba(0, 0, 0, 0.5)) it would extract the following parts

{
  "pre": "",
  "body": "--box-shadow, 0px 2px 8px 0px rgba(0, 0, 0, 0.5",
  "post": ")"
}

as it finds the var( look for the closing ) token, which it then finds just after 0.5. Instead it should look for ( ) pairs, and check if the opening ( is after var. This way in the previous case, it would find:

{
  "pre": "",
  "body": "--box-shadow, 0px 2px 8px 0px rgba(0, 0, 0, 0.5)",
  "post": ""
}

@MadLittleMods MadLittleMods merged commit bbbd64d into MadLittleMods:master Apr 24, 2020
MadLittleMods added a commit that referenced this pull request Apr 24, 2020
@MadLittleMods
Copy link
Owner

Thanks for the contribution @Poetro! Sorry for the delay 🙇

Appreciate the clear code and tests ❤️

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parenthesis problem

2 participants