mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-28 23:10:46 +00:00
More defensive checks
We’ve had a few bugs with the symptom of ‘text’ being undefined.
This commit is contained in:
parent
7998686cb3
commit
5a23c883e2
@ -136,7 +136,7 @@ Widget.prototype.substituteVariableParameters = function(text,formalParams,actua
|
|||||||
|
|
||||||
Widget.prototype.substituteVariableReferences = function(text) {
|
Widget.prototype.substituteVariableReferences = function(text) {
|
||||||
var self = this;
|
var self = this;
|
||||||
return text.replace(/\$\(([^\)\$]+)\)\$/g,function(match,p1,offset,string) {
|
return (text || "").replace(/\$\(([^\)\$]+)\)\$/g,function(match,p1,offset,string) {
|
||||||
return self.getVariable(p1,{defaultValue: ""});
|
return self.getVariable(p1,{defaultValue: ""});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user