Revision: 3958
Author: wikipedian
Date: 2007-08-03 03:31:06 +0000 (Fri, 03 Aug 2007)
Log Message:
-----------
sped up "blowing up" of templates by making sure that spaces are only
added inside the templates, not in unrelated wikilinks following it
Modified Paths:
--------------
trunk/pywikipedia/weblinkchecker.py
Modified: trunk/pywikipedia/weblinkchecker.py
===================================================================
--- trunk/pywikipedia/weblinkchecker.py 2007-08-03 00:24:24 UTC (rev 3957)
+++ trunk/pywikipedia/weblinkchecker.py 2007-08-03 03:31:06 UTC (rev 3958)
@@ -107,7 +107,7 @@
# might be a | or a } directly after a URL which does not belong to
# the URL itself.
# Blow up templates with spaces to avoid these problems.
- templateWithParamsR = re.compile(r'{{(.*?[^ ])\|([^ ].*?)}}', re.DOTALL)
+ templateWithParamsR = re.compile(r'{{([^}]*?[^ ])\|([^ ][^}]*?)}}',
re.DOTALL)
while templateWithParamsR.search(text):
text = templateWithParamsR.sub(r'{{ \1 | \2 }}', text)
Show replies by date