Marcoil has uploaded a new change for review. https://gerrit.wikimedia.org/r/134824
Change subject: WIP: Replace inTemplate pipeline option with !wrapTemplates ...................................................................... WIP: Replace inTemplate pipeline option with !wrapTemplates Change-Id: I6339f8e3efcaa111136bf4d3cc8c49a5023dfa41 --- M lib/ext.Cite.js M lib/ext.core.TemplateHandler.js M lib/mediawiki.DOMPostProcessor.js 3 files changed, 4 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid refs/changes/24/134824/1 diff --git a/lib/ext.Cite.js b/lib/ext.Cite.js index 1e002c5..3459300 100644 --- a/lib/ext.Cite.js +++ b/lib/ext.Cite.js @@ -77,7 +77,7 @@ Ref.prototype.handleRef = function ( manager, pipelineOpts, refTok, cb ) { // Nested <ref> tags at the top level are considered errors // But, inside templates, they are supported - if (!pipelineOpts.inTemplate && pipelineOpts.extTag === "ref") { + if (pipelineOpts.wrapTemplates && pipelineOpts.extTag === "ref") { cb({ tokens: [refTok.getAttribute("source")] }); return; } @@ -114,7 +114,6 @@ // Full pipeline for processing ref-content pipelineType: 'text/x-mediawiki/full', pipelineOpts: { - inTemplate: pipelineOpts.inTemplate, noPre: true, extTag: "ref" }, @@ -321,8 +320,7 @@ // object, we have to pass along the references id. extTag: "references", extTagId: referencesId, - wrapTemplates: pipelineOpts.wrapTemplates, - inTemplate: pipelineOpts.inTemplate + wrapTemplates: pipelineOpts.wrapTemplates }, res: [], parentCB: cb, diff --git a/lib/ext.core.TemplateHandler.js b/lib/ext.core.TemplateHandler.js index d379b79..75e6562 100644 --- a/lib/ext.core.TemplateHandler.js +++ b/lib/ext.core.TemplateHandler.js @@ -624,7 +624,6 @@ { pipelineType: type || 'text/x-mediawiki', pipelineOpts: { - inTemplate: true, isInclude: true, // NOTE: No template wrapping required for nested templates. wrapTemplates: false, @@ -770,7 +769,7 @@ env = this.manager.env, chunk = this.getEncapsulationInfo(state); - if (!this.options.inTemplate && state.recordArgDict) { + if (state.recordArgDict) { // Get the arg dict var argInfo = this.getArgInfo(state), argDict = argInfo.dict; diff --git a/lib/mediawiki.DOMPostProcessor.js b/lib/mediawiki.DOMPostProcessor.js index 9c188d5..1cec8ad 100644 --- a/lib/mediawiki.DOMPostProcessor.js +++ b/lib/mediawiki.DOMPostProcessor.js @@ -159,7 +159,7 @@ migrateTrailingNLs ]; - if (options.wrapTemplates && !options.inTemplate) { + if (options.wrapTemplates) { // dsr computation and tpl encap are only relevant // for top-level content that is not wrapped in an extension this.processors.push(computeDSR); -- To view, visit https://gerrit.wikimedia.org/r/134824 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6339f8e3efcaa111136bf4d3cc8c49a5023dfa41 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