Cscott has uploaded a new change for review.
https://gerrit.wikimedia.org/r/186404
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(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid
refs/changes/04/186404/1
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..e66fd7f 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==null) {
+ 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: newchange
Gerrit-Change-Id: I492319fa1b5dcf0ddad4c7a939ee058f41ab3a80
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits