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

Conversation

Projects
None yet
1 participant
@tivac
Copy link
Owner

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.
fix: use a safer regex for finding @values
"\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

@tivac tivac self-assigned this Jan 24, 2019

@codecov

This comment has been minimized.

Copy link

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.

@tivac tivac merged commit c6a684c into master Jan 24, 2019

4 checks passed

codecov/patch 100% of diff hit (target 98.92%)
Details
codecov/project 98.92% (+0%) compared to 443ce55
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@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
You can’t perform that action at this time.