use replaceAll()
instead of replace()
when turning a label
into a regex
#1078
Milestone
replaceAll()
instead of replace()
when turning a label
into a regex
#1078
Describe the bug
replace()
is only replacing the first occurrence of a string;replaceAll()
should be used instead.affected code location:
vscode-yaml/src/schema-extension-api.ts
Line 83 in 1f14ee6
Expected Behavior
if a
label
value contains more than one dot.
all dots should be handled correctly and turned into the proper regex expression:apiVersion: some-schema/v1.0.0
->apiVersion:[\t ]+some-schema/v1\.0\.0
Current Behavior
if a
label
value contains more than one dot.
the generated regex does not handle the subsequent dots properly (note the missing escaping for the second dot):apiVersion: some-schema/v1.0.0
->apiVersion:[\t ]+some-schema/v1\.0.0
Steps to Reproduce
see above
Environment
The text was updated successfully, but these errors were encountered: