http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9958
Revision: 9958
Author: xqt
Date: 2012-03-02 17:12:15 +0000 (Fri, 02 Mar 2012)
Log Message:
-----------
remove empty <ref></ref> tag
Modified Paths:
--------------
trunk/pywikipedia/cosmetic_changes.py
Modified: trunk/pywikipedia/cosmetic_changes.py
===================================================================
--- trunk/pywikipedia/cosmetic_changes.py 2012-03-02 17:05:08 UTC (rev 9957)
+++ trunk/pywikipedia/cosmetic_changes.py 2012-03-02 17:12:15 UTC (rev 9958)
@@ -612,7 +612,7 @@
r'(?i)([\r\n]) *<h%d> *([^<]+?)
*</h%d> *([\r\n])'%(level, level),
r'%s'%equals, exceptions)
#remove empty <ref/>-tag
- text = pywikibot.replaceExcept(text, r'(?i)<ref\s*/>', r'',
exceptions)
+ text = pywikibot.replaceExcept(text, r'(?i)(<ref\s*/>|<ref
*>\s*</ref>)', r'', exceptions)
# TODO: maybe we can make the bot replace <p> tags with \r\n's.
return text