http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11413
Revision: 11413 Author: xqt Date: 2013-04-21 15:45:32 +0000 (Sun, 21 Apr 2013) Log Message: ----------- Templates may contain curling brackets, bugfix for bug #3021792
Modified Paths: -------------- trunk/pywikipedia/pywikibot/textlib.py
Modified: trunk/pywikipedia/pywikibot/textlib.py =================================================================== --- trunk/pywikipedia/pywikibot/textlib.py 2013-04-21 13:07:03 UTC (rev 11412) +++ trunk/pywikipedia/pywikibot/textlib.py 2013-04-21 15:45:32 UTC (rev 11413) @@ -19,7 +19,8 @@ from HTMLParser import HTMLParser import config
-TEMP_REGEX = re.compile('{{(msg:)?(?P<name>[^{|]+?)(|(?P<params>[^{]+?))?}}') +TEMP_REGEX = re.compile( + '{{(?:msg:)?(?P<name>[^{|]+?)(?:|(?P<params>[^{]+?(?:{[^{]+?}[^{]*?)?))?}}')
def unescape(s): """Replace escaped HTML-special characters by their originals"""
pywikipedia-svn@lists.wikimedia.org