From a439cb58bed3b1c7be96fc9cfe04f2f5bb431e4c Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Sat, 3 Sep 2022 20:11:23 +0100 Subject: [PATCH] Fix caching of parse variables/macros/procedures --- core/modules/widgets/transclude.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/modules/widgets/transclude.js b/core/modules/widgets/transclude.js index b02e93a0b0..b71f75c907 100755 --- a/core/modules/widgets/transclude.js +++ b/core/modules/widgets/transclude.js @@ -176,13 +176,13 @@ TranscludeWidget.prototype.getTransclusionTarget = function() { var variableInfo = this.getVariableInfo(this.transcludeVariable,{params: this.getOrderedTransclusionParameters()}), srcVariable = variableInfo && variableInfo.srcVariable; if(srcVariable) { - var mode = parseAsInline ? "inlineParser" : "blockParser"; - if(srcVariable.isCacheable && srcVariable[mode]) { - parser = srcVariable[mode]; + var cacheKey = (parseAsInline ? "inlineParser" : "blockParser") + (this.transcludeType || ""); + if(variableInfo.isCacheable && srcVariable[cacheKey]) { + parser = srcVariable[cacheKey]; } else { parser = this.wiki.parseText(this.transcludeType,variableInfo.text || "",{parseAsInline: parseAsInline, configTrimWhiteSpace: srcVariable.configTrimWhiteSpace}); - if(srcVariable.isCacheable) { - srcVariable[mode] = parser; + if(variableInfo.isCacheable) { + srcVariable[cacheKey] = parser; } } if(parser) {