jenkins-bot has submitted this change and it was merged.
Change subject: Only minimize interwikis when content was edited
......................................................................
Only minimize interwikis when content was edited
Change-Id: Id8b773ea0f1136e708fcb4e9628b1d0c151c028e
---
M js/lib/ext.core.LinkHandler.js
M js/lib/mediawiki.WikitextSerializer.js
M js/tests/parserTests-blacklist.js
3 files changed, 3 insertions(+), 8 deletions(-)
Approvals:
Subramanya Sastry: Looks good to me, approved
jenkins-bot: Verified
diff --git a/js/lib/ext.core.LinkHandler.js b/js/lib/ext.core.LinkHandler.js
index 60dbae5..51bf2ad 100644
--- a/js/lib/ext.core.LinkHandler.js
+++ b/js/lib/ext.core.LinkHandler.js
@@ -448,6 +448,8 @@
// Change the rel to be mw:ExtLink
Util.lookupKV( newTk.attribs, 'rel' ).v = 'mw:ExtLink';
+ // Remember that this was using wikitext syntax though
+ newTk.dataAttribs.isIW = true;
tokens.push( newTk );
diff --git a/js/lib/mediawiki.WikitextSerializer.js
b/js/lib/mediawiki.WikitextSerializer.js
index 6cf7b99..8cc6b67 100644
--- a/js/lib/mediawiki.WikitextSerializer.js
+++ b/js/lib/mediawiki.WikitextSerializer.js
@@ -1780,7 +1780,7 @@
var targetVal = target.fromsrc || true ? target.value :
Util.decodeURI(target.value);
// Check if the href matches any of our interwiki URL
patterns
var interWikiMatch =
env.conf.wiki.InterWikiMatcher.match(href);
- if (interWikiMatch) {
+ if (interWikiMatch && (dp.isIW || target.modified ||
linkData.contentModified)) {
//console.log(interWikiMatch);
// External link that is really an interwiki
link. Convert it.
linkData.type = 'mw:WikiLink';
diff --git a/js/tests/parserTests-blacklist.js
b/js/tests/parserTests-blacklist.js
index d168890..dbc0859 100644
--- a/js/tests/parserTests-blacklist.js
+++ b/js/tests/parserTests-blacklist.js
@@ -613,7 +613,6 @@
add("wt2wt", "Image with multiple captions -- only last one is accepted
(parsoid)");
add("wt2wt", "BUG 561: {{/Subpage}}");
add("wt2wt", "Handling of sections up to level 6 and beyond");
-add("wt2wt", "Bug 1186 news: in the middle of text");
add("wt2wt", "div with single-quoted attribute");
add("wt2wt", "div with unquoted attribute");
add("wt2wt", "div with illegal double attributes");
@@ -3184,12 +3183,6 @@
add("selser", "Handling of sections up to level 6 and beyond
[0,0,4,0,4,0,0,0,4,0,0,2,[3],4,0,0,[3],0,3]", "= Level 1
Heading=\nhu2xawss5ze61or\n7euacpk0x86ywrk9\n==== Level 4
Heading====\n66btsq84yh0vn29\n====== Level 6 Heading======\n======= Level 7
Heading=======\n======== Level 8 Heading========\n========= Level 9
Heading=========\n");
add("selser", "Handling of sections up to level 6 and beyond
[0,0,1,4,4,4,[2],4,1,0,[4],0,[2],4,[4],0,[3],0,[4]]", "= Level 1 Heading=\n==
Level 2 Heading==\nuld6v80z0ssjor\n==== Level 4 Heading====\n===== Level 5
Heading=====\n====== Level 6 Heading======\n======= Level 7
Heading=======\n======== Level 8 Heading========\n========= Level 9
Heading=========\n========== Level 10 Heading==========");
add("selser", "Handling of sections up to level 6 and beyond
[[4],2,3,2,3,2,1,2,1,2,2,4,4,0,1,0,[4],0,[4]]", "= Level 1 Heading=\n\n====
Level 4 Heading====\n===== Level 5 Heading=====\njkhszwjmnej3jtt9\n====== Level
6 Heading======\nsrbgae3yy45f80k9\n======<nowiki>== Level 8
Heading==</nowiki>======\n========= Level 9 Heading=========\n========== Level
10 Heading==========");
-add("selser", "Bug 1186 news: in the middle of text [1]",
"http://en.wikinews.org/wiki/Wikinews:Workplace");
-add("selser", "Bug 1186 news: in the middle of text [2]",
"u5bm8s3x9k3ayvi\n\nhttp://en.wikinews.org/wiki/Wikinews:Workplace");
-add("selser", "Bug 1186 news: in the middle of text [[[2]]]",
"http://en.wikinews.org/wiki/Wikinews:Workplace");
-add("selser", "Bug 1186 news: in the middle of text [[2]]",
"q7lc2s8m0t62mx6rhttp://en.wikinews.org/wiki/Wikinews:Workplace");
-add("selser", "Bug 1186 news: in the middle of text [[[3]]]",
"http://en.wikinews.org/wiki/Wikinews:Workplace");
-add("selser", "Bug 1186 news: in the middle of text [[[4]]]",
"http://en.wikinews.org/wiki/Wikinews:Workplace");
add("selser", "div with single-quoted attribute [2]", "qu686umowmw8kt9<div
id='rock'>HTML rocks</div>");
add("selser", "div with single-quoted attribute [[4]]", "<div id='rock'>HTML
rocks</div>");
add("selser", "div with single-quoted attribute [[2]]", "<div id='rock'>HTML
rocks</div>");
--
To view, visit https://gerrit.wikimedia.org/r/90412
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id8b773ea0f1136e708fcb4e9628b1d0c151c028e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: GWicke <[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