Revision: 7927 Author: xqt Date: 2010-02-14 11:59:42 +0000 (Sun, 14 Feb 2010)
Log Message: ----------- do not fixTypo() inside all sorts of links but fixArabicLetters() inside wiki links as requested
Modified Paths: -------------- trunk/pywikipedia/cosmetic_changes.py
Modified: trunk/pywikipedia/cosmetic_changes.py =================================================================== --- trunk/pywikipedia/cosmetic_changes.py 2010-02-12 10:39:37 UTC (rev 7926) +++ trunk/pywikipedia/cosmetic_changes.py 2010-02-14 11:59:42 UTC (rev 7927) @@ -229,7 +229,7 @@ # This also removes all template parameters of {{Foo}} # For replacing {{Foo}} with {{Bar}} but keep the template # parameters in its original order, please use: -# (u'Foo', u'Bar\g<parameters>), +# (u'Foo', u'Bar\g<parameters>'),
deprecatedTemplates = { 'wikipedia': { @@ -667,7 +667,7 @@ return text
def fixTypo(self, text): - exceptions = ['nowiki', 'comment', 'math', 'pre', 'source', 'startspace'] + exceptions = ['nowiki', 'comment', 'math', 'pre', 'source', 'startspace', 'gallery', 'hyperlink', 'interwiki', 'link'] # change <number> ccm -> <number> cm³ text = pywikibot.replaceExcept(text, ur'(\d)\s* ccm', ur'\1 cm³', exceptions) text = pywikibot.replaceExcept(text, ur'(\d)\s*ccm', ur'\1 cm³', exceptions) @@ -686,7 +686,8 @@ 'gallery', 'hyperlink', 'interwiki', - 'link', + # but changes letters inside wikilinks + #'link', 'math', 'pre', 'template',
pywikipedia-svn@lists.wikimedia.org