This commit is contained in:
parent
2740fe3ee9
commit
34e8e242f6
1 changed files with 2 additions and 2 deletions
|
|
@ -436,7 +436,7 @@ export const placeholdersUtils = {
|
||||||
return match;
|
return match;
|
||||||
}
|
}
|
||||||
// Replace if found, otherwise keep the original or substitute with default value
|
// Replace if found, otherwise keep the original or substitute with default value
|
||||||
return replacements[p1] || (use_default_value ? currPlaceholder.default_value : match);
|
return replacements[p1] || replacements[currPlaceholder.id] || (use_default_value ? currPlaceholder.default_value : match);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -459,7 +459,7 @@ export const placeholdersUtils = {
|
||||||
// If a specific placeholder is provided, we search for it
|
// If a specific placeholder is provided, we search for it
|
||||||
if (placeholder !== "") {
|
if (placeholder !== "") {
|
||||||
// Dynamically build the regex for the specific placeholder
|
// Dynamically build the regex for the specific placeholder
|
||||||
regex = new RegExp(`{%\s*${placeholder}\s*%}`);
|
regex = new RegExp(`{%\s*${placeholder}(:.*?)?\s*%}`);
|
||||||
} else {
|
} else {
|
||||||
// Otherwise, we search for any placeholder in the format {% ... %}
|
// Otherwise, we search for any placeholder in the format {% ... %}
|
||||||
regex = /{%\s*(.*?)\s*%}/;
|
regex = /{%\s*(.*?)\s*%}/;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue