mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-05-03 11:57:23 +00:00
Cache result of parsing macro calls which don't use text subsitution (#5205)
This commit is contained in:
@@ -113,7 +113,8 @@ Widget.prototype.getVariableInfo = function(name,options) {
|
||||
// Check for the variable defined in the parent widget (or an ancestor in the prototype chain)
|
||||
if(parentWidget && name in parentWidget.variables) {
|
||||
var variable = parentWidget.variables[name],
|
||||
value = variable.value,
|
||||
originalValue = variable.value,
|
||||
value = originalValue,
|
||||
params = this.resolveVariableParameters(variable.params,actualParams);
|
||||
// Substitute any parameters specified in the definition
|
||||
$tw.utils.each(params,function(param) {
|
||||
@@ -125,7 +126,9 @@ Widget.prototype.getVariableInfo = function(name,options) {
|
||||
}
|
||||
return {
|
||||
text: value,
|
||||
params: params
|
||||
params: params,
|
||||
srcVariable: variable,
|
||||
isCacheable: originalValue === value
|
||||
};
|
||||
}
|
||||
// If the variable doesn't exist in the parent widget then look for a macro module
|
||||
|
||||
Reference in New Issue
Block a user