jenkins-bot has submitted this change and it was merged.

Change subject: Factor out default processTokensToDOM options.
......................................................................


Factor out default processTokensToDOM options.

Change-Id: I492319fa1b5dcf0ddad4c7a939ee058f41ab3a80
---
M lib/ext.core.LinkHandler.js
M lib/mediawiki.Util.js
2 files changed, 14 insertions(+), 8 deletions(-)

Approvals:
  Subramanya Sastry: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/ext.core.LinkHandler.js b/lib/ext.core.LinkHandler.js
index d4d69a2..9514889 100644
--- a/lib/ext.core.LinkHandler.js
+++ b/lib/ext.core.LinkHandler.js
@@ -477,6 +477,7 @@
                        this.manager.env,
                        this.manager.frame,
                        content,
+                       null /* default options */,
                        function(dom) {
                                var sortKeyInfo = [ {"txt": "mw:sortKey"}, 
{"html": dom.body.innerHTML} ],
                                        dataMW = newTk.getAttribute("data-mw");
diff --git a/lib/mediawiki.Util.js b/lib/mediawiki.Util.js
index 3993e77..e4a71cb 100644
--- a/lib/mediawiki.Util.js
+++ b/lib/mediawiki.Util.js
@@ -1140,23 +1140,27 @@
         * @param {Object} cb
         *    The callback to pass back the DOM to.
         */
-       processTokensToDOM: function(env, frame, tokens, cb) {
+       processTokensToDOM: function(env, frame, tokens, opts, cb) {
                if (!Array.isArray(tokens)) {
                        cb(tokens);
                        return;
                }
-
+               var pipelineOpts = opts && opts.pipelineOpts;
+               if (!pipelineOpts) {
+                       pipelineOpts = {
+                               attrExpansion: true,
+                               noPWrapping: true,
+                               noPre: true,
+                               wrapTemplates: true
+                       };
+               }
                this.processContentInPipeline(
                        env,
                        frame,
                        tokens.concat([new pd.EOFTk()]), {
                                pipelineType: "tokens/x-mediawiki/expanded",
-                               pipelineOpts: {
-                                       attrExpansion: true,
-                                       noPWrapping: true,
-                                       noPre: true,
-                                       wrapTemplates: true
-                               },
+                               pipelineOpts: pipelineOpts,
+                               srcOffsets: opts ? opts.srcOffsets : undefined,
                                documentCB: cb
                        }
                );
@@ -1194,6 +1198,7 @@
                                                env,
                                                frame,
                                                v.html,
+                                               null /* default options */,
                                                function(dom) {
                                                        v.html = 
dom.body.innerHTML;
                                                        cb(null, v);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I492319fa1b5dcf0ddad4c7a939ee058f41ab3a80
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
Gerrit-Reviewer: Arlolra <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to