Skip to content

Commit

Permalink
Merge pull request #13 from cjwillcock/cjw-bugfix-1
Browse files Browse the repository at this point in the history
Allow for pseudo-class position with repeat > 9n, no additional offset
  • Loading branch information
ThomasWeinert authored Jun 20, 2018
2 parents 22959c8 + ec1df18 commit 05de8df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/PhpCss/Scanner/Patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ abstract class Patterns {
const PSEUDO_ELEMENT = '(::[^\r\n\t .,#:()[\\]\\\'"]+)S';

const ATTRIBUTE_OPERATOR = '([~^$*|]?=)S';
const PSEUDO_CLASS_POSITION = '(\s*(([-+]?(\\d+)?n\\s*[-+]\\s*\\d+)|\\dn)\s*)';
const PSEUDO_CLASS_POSITION = '(\s*(([-+]?(\\d+)?n\\s*[-+]\\s*\\d+)|\\d+n)\s*)';
}
}
1 change: 1 addition & 0 deletions tests/PhpCssTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public static function provideReformattedCss() {
array('tr:nth-child(even)', 'tr:nth-child(2n+0)'),
array('tr:nth-child(even)', 'tr:nth-child(even)'),
array('p:nth-child(4n+1)', 'p:nth-child(4n+1)'),
array(':nth-child(10n)', ':nth-child(10n)'),
array(':nth-child(10n-1)', ':nth-child(10n-1)'),
array(':nth-child(10n+9)', ':nth-child(10n+9)'),
array('foo:nth-child(5)', 'foo:nth-child(0n+5)'),
Expand Down

0 comments on commit 05de8df

Please sign in to comment.