Fixed substitute attributes to allow more variables (#9059)

This commit is contained in:
Cameron Fischer
2025-06-03 12:30:40 -04:00
committed by GitHub
parent 48b45f0e35
commit f1b33c02f7
2 changed files with 4 additions and 4 deletions

View File

@@ -1173,7 +1173,7 @@ exports.getSubstitutedText = function(text,widget,options) {
output = $tw.utils.replaceString(output,new RegExp("\\$" + $tw.utils.escapeRegExp(substitute.name) + "\\$","mg"),substitute.value);
});
// Substitute any variable references with their values
return output.replace(/\$\(([^\)\$]+)\)\$/g, function(match,varname) {
return output.replace(/\$\((.+?)\)\$/g, function(match,varname) {
return widget.getVariable(varname,{defaultValue: ""})
});
};