Revision: 7693 Author: xqt Date: 2009-11-25 22:14:36 +0000 (Wed, 25 Nov 2009)
Log Message: ----------- handle exceptionRegex <source /> alias <syntaxhighlight />
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2009-11-25 13:47:03 UTC (rev 7692) +++ trunk/pywikipedia/wikipedia.py 2009-11-25 22:14:36 UTC (rev 7693) @@ -4137,6 +4137,9 @@ if exc not in exceptionRegexes: raise ValueError("Unknown tag type: " + exc) dontTouchRegexes.append(exceptionRegexes[exc]) + # handle alias + if exc == 'source': + dontTouchRegexes.append(re.compile(r'(?is)<syntaxhighlight .*?</syntaxhighlight>')) else: # assume it's a regular expression dontTouchRegexes.append(exc)
pywikipedia-svn@lists.wikimedia.org