Fix candidate detection regex
This commit is contained in:
parent
6dfcdd1007
commit
d2bb6f1bd0
1 changed files with 12 additions and 2 deletions
|
|
@ -47,7 +47,12 @@ function* buildRegExps(context) {
|
|||
regex.any([
|
||||
regex.pattern([
|
||||
// Arbitrary values
|
||||
/-(?:\w+-)*\[(?:[^\s\[\]]+\[[^\s\[\]]+\])*[^\s:\[\]]+\]/,
|
||||
regex.any([
|
||||
/-(?:\w+-)*\['[^\s]+'\]/,
|
||||
/-(?:\w+-)*\["[^\s]+"\]/,
|
||||
/-(?:\w+-)*\[`[^\s]+`\]/,
|
||||
/-(?:\w+-)*\[(?:[^\s\[\]]+\[[^\s\[\]]+\])*[^\s:\[\]]+\]/,
|
||||
]),
|
||||
|
||||
// Not immediately followed by an `{[(`
|
||||
/(?![{([]])/,
|
||||
|
|
@ -58,7 +63,12 @@ function* buildRegExps(context) {
|
|||
|
||||
regex.pattern([
|
||||
// Arbitrary values
|
||||
/-(?:\w+-)*\[(?:[^\s\[\]]+\[[^\s\[\]]+\])*[^\s:\[\]]+\]/,
|
||||
regex.any([
|
||||
/-(?:\w+-)*\['[^\s]+'\]/,
|
||||
/-(?:\w+-)*\["[^\s]+"\]/,
|
||||
/-(?:\w+-)*\[`[^\s]+`\]/,
|
||||
/-(?:\w+-)*\[(?:[^\s\[\]]+\[[^\s\[\]]+\])*[^\s\[\]]+\]/,
|
||||
]),
|
||||
|
||||
// Not immediately followed by an `{[(`
|
||||
/(?![{([]])/,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue