From c4fc3168d1339624d9b6941cb789b8443aa690f7 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Thu, 27 Jul 2023 18:39:59 +0100 Subject: [PATCH] Refactor parse mode out of getTransclusionTarget --- core/modules/widgets/transclude.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/core/modules/widgets/transclude.js b/core/modules/widgets/transclude.js index 05d03a702..ad9f26f8b 100755 --- a/core/modules/widgets/transclude.js +++ b/core/modules/widgets/transclude.js @@ -41,8 +41,15 @@ TranscludeWidget.prototype.execute = function() { this.collectAttributes(); this.collectStringParameters(); this.collectSlotFillParameters(); + // Determine whether we're being used in inline or block mode + var parseAsInline = !this.parseTreeNode.isBlock; + if(this.transcludeMode === "inline") { + parseAsInline = true; + } else if(this.transcludeMode === "block") { + parseAsInline = false; + } // Get the target text and parse tree nodes that we are transcluding - var target = this.getTransclusionTarget(), + var target = this.getTransclusionTarget(parseAsInline), parseTreeNodes; this.sourceText = target.text; this.parserType = target.type; @@ -163,15 +170,8 @@ TranscludeWidget.prototype.collectSlotFillParameters = function() { /* Get transcluded parse tree nodes as an object {text:,type:,parseTreeNodes:,parseAsInline:} */ -TranscludeWidget.prototype.getTransclusionTarget = function() { +TranscludeWidget.prototype.getTransclusionTarget = function(parseAsInline) { var self = this; - // Determine whether we're being used in inline or block mode - var parseAsInline = !this.parseTreeNode.isBlock; - if(this.transcludeMode === "inline") { - parseAsInline = true; - } else if(this.transcludeMode === "block") { - parseAsInline = false; - } var parser; // Get the parse tree if(this.hasAttribute("$variable")) {