jenkins-bot has submitted this change and it was merged. Change subject: Disable cleanUpLinks in cosmetic_changes.py in Persian language wikis ......................................................................
Disable cleanUpLinks in cosmetic_changes.py in Persian language wikis Community thinks this function has too many issues. I do this upon request of User:Yamaha5 The discussion is here: http://bit.ly/1KMVZ7J Also improving documentation of cleanUpLinks. Reinvent of I4f40c7a89a6fd698009a6290e18948e3924f4f78 Change-Id: I1a342e0f0311764009d67d073fce74ee91a897f9 --- M cosmetic_changes.py 1 file changed, 10 insertions(+), 2 deletions(-) Approvals: Ladsgroup: Looks good to me, approved jenkins-bot: Verified diff --git a/cosmetic_changes.py b/cosmetic_changes.py index b15c226..a13be5d 100644 --- a/cosmetic_changes.py +++ b/cosmetic_changes.py @@ -375,9 +375,13 @@ return text def cleanUpLinks(self, text): - # helper function which works on one link and either returns it - # unmodified, or returns a replacement. + """Cleanup wiki links.""" + def handleOneLink(match): + """Helper function for one link. + + Either returns it unmodified, or returns a replacement. + """ titleWithSection = match.group('titleWithSection') label = match.group('label') trailingChars = match.group('linktrail') @@ -483,6 +487,10 @@ # don't change anything return match.group() + if self.site.sitename() == u'wikipedia:fa': + # Per community discussion, this one is not allowed in fa.wp + return text # unmodified text + trailR = re.compile(self.site.linktrail()) # The regular expression which finds links. Results consist of four groups: # group <newline> depends whether the links starts with a new line. -- To view, visit https://gerrit.wikimedia.org/r/211139 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1a342e0f0311764009d67d073fce74ee91a897f9 Gerrit-PatchSet: 3 Gerrit-Project: pywikibot/compat Gerrit-Branch: master Gerrit-Owner: Xqt <i...@gno.de> Gerrit-Reviewer: John Vandenberg <jay...@gmail.com> Gerrit-Reviewer: Ladsgroup <ladsgr...@gmail.com> Gerrit-Reviewer: Ricordisamoa <ricordisa...@openmailbox.org> Gerrit-Reviewer: XZise <commodorefabia...@gmx.de> Gerrit-Reviewer: Xqt <i...@gno.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits