- exclude custom placeholder content if there was no match
This commit is contained in:
+5
-3
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+3
-1
@@ -337,7 +337,8 @@ function replacePlaceholders(
|
|||||||
if (transformer?.pattern) {
|
if (transformer?.pattern) {
|
||||||
const extractedValue = value.replace(transformer.pattern, transformer.target)
|
const extractedValue = value.replace(transformer.pattern, transformer.target)
|
||||||
// note: `.replace` will return the full string again if there was no match
|
// note: `.replace` will return the full string again if there was no match
|
||||||
if (extractedValue && placeholderPrMap && extractedValue !== value) {
|
if (extractedValue && extractedValue !== value) {
|
||||||
|
if (placeholderPrMap) {
|
||||||
createOrSet(placeholderPrMap, placeholder.name, extractedValue)
|
createOrSet(placeholderPrMap, placeholder.name, extractedValue)
|
||||||
}
|
}
|
||||||
transformed = transformed.replaceAll(`\${{${placeholder.name}}}`, extractedValue)
|
transformed = transformed.replaceAll(`\${{${placeholder.name}}}`, extractedValue)
|
||||||
@@ -345,6 +346,7 @@ function replacePlaceholders(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return transformed
|
return transformed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user