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: use a safer regex for finding @values #552

Merged
merged 1 commit into from Jan 24, 2019
Merged

fix: use a safer regex for finding @values #552

merged 1 commit into from Jan 24, 2019

Conversation

@tivac
Copy link
Owner

@tivac tivac commented Jan 24, 2019

Description

\bval\b will match "-val" which is a problem for folks using hyphens to separate classes. Now using ^val$ which when combined with postcss-value-parser should match almost everything the old one did but w/o being too greedy.

Motivation and Context

Fixes #548

How Has This Been Tested?

Added a test with a bunch of permutations seen in CSS values/@media, manually verified that they all transform correctly after this change.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
"\bval\b" will match "-val" which is a problem for folks using hyphens to separate classes. Now using "^val$" which when combined with postcss-value-parser should match almost everything the old one did but w/o being too greedy.

Fixes #548
@codecov
Copy link

@codecov codecov bot commented Jan 24, 2019

Codecov Report

Merging #552 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #552   +/-   ##
=======================================
  Coverage   98.92%   98.92%           
=======================================
  Files          46       46           
  Lines        1026     1026           
  Branches      157      157           
=======================================
  Hits         1015     1015           
  Misses         11       11
Impacted Files Coverage Δ
packages/processor/plugins/values-replace.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 443ce55...3ed8545. Read the comment docs.

Loading

@tivac tivac merged commit c6a684c into master Jan 24, 2019
4 checks passed
Loading
@tivac tivac deleted the safer-value-matching branch Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

1 participant