Marcoil has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/188820

Change subject: Internal expander: Pass along the inTemplate flag
......................................................................

Internal expander: Pass along the inTemplate flag

This is necessary to test cases where templates are found inside
an extension produced by a template expansion like
X {{echo|<ref>{{echo|bar}}</ref>}}

Change-Id: Ieb7e56bddccb8b5a1f9b5fbc106e3b88baa5be56
---
M lib/ext.core.TemplateHandler.js
M lib/mediawiki.TokenTransformManager.js
2 files changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/20/188820/1

diff --git a/lib/ext.core.TemplateHandler.js b/lib/ext.core.TemplateHandler.js
index fa1d8ba..d92aefe 100644
--- a/lib/ext.core.TemplateHandler.js
+++ b/lib/ext.core.TemplateHandler.js
@@ -189,7 +189,7 @@
                // XXX: would likely be faster to do this in a tight loop here
                var atm = new AttributeTransformManager(
                                        this.manager,
-                                       { wrapTemplates: false },
+                                       {wrapTemplates: false, inTemplate: 
true},
                                        this._expandTemplate.bind( this, state, 
frame, tgt,
                                                accumReceiveToksFromSibling )
                                );
diff --git a/lib/mediawiki.TokenTransformManager.js 
b/lib/mediawiki.TokenTransformManager.js
index 3808600..0a0a879 100644
--- a/lib/mediawiki.TokenTransformManager.js
+++ b/lib/mediawiki.TokenTransformManager.js
@@ -1032,6 +1032,7 @@
                                // transform the value
                                this.frame.expand( v, {
                                                        wrapTemplates: 
this.options.wrapTemplates,
+                                                       inTemplate: 
this.options.inTemplate,
                                                        type: this._toType,
                                                        cb: 
this._returnAttributeValue.bind( this, i )
                                                } );
@@ -1399,7 +1400,8 @@
 
                var pipelineOpts = {
                        isInclude: this.depth > 0,
-                       wrapTemplates: options.wrapTemplates
+                       wrapTemplates: options.wrapTemplates,
+                       inTemplate: options.inTemplate
                };
 
                var pipeline = this.manager.pipeFactory.getPipeline(

-- 
To view, visit https://gerrit.wikimedia.org/r/188820
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieb7e56bddccb8b5a1f9b5fbc106e3b88baa5be56
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Marcoil <marc...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to