Ensure variants with arbitrary values and a modifier are correctly matched in the RegEx based parser (#12179)
* add failing test * ensure variants can have modifiers in regex * update changelog
This commit is contained in:
parent
51ac627491
commit
fa9be73c15
3 changed files with 31 additions and 0 deletions
|
|
@ -80,12 +80,18 @@ function* buildRegExps(context) {
|
|||
// This is here to provide special support for the `@` variant
|
||||
regex.pattern([/@\[[^\s"'`]+\](\/[^\s"'`]+)?/, separator]),
|
||||
|
||||
// With variant modifier (e.g.: group-[..]/modifier)
|
||||
regex.pattern([/([^\s"'`\[\\]+-)?\[[^\s"'`]+\]\/\w+/, separator]),
|
||||
|
||||
regex.pattern([/([^\s"'`\[\\]+-)?\[[^\s"'`]+\]/, separator]),
|
||||
regex.pattern([/[^\s"'`\[\\]+/, separator]),
|
||||
]),
|
||||
|
||||
// With quotes allowed
|
||||
regex.any([
|
||||
// With variant modifier (e.g.: group-[..]/modifier)
|
||||
regex.pattern([/([^\s"'`\[\\]+-)?\[[^\s`]+\]\/\w+/, separator]),
|
||||
|
||||
regex.pattern([/([^\s"'`\[\\]+-)?\[[^\s`]+\]/, separator]),
|
||||
regex.pattern([/[^\s`\[\\]+/, separator]),
|
||||
]),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue