Revision: 5219 Author: btongminh Date: 2008-04-15 09:30:16 +0000 (Tue, 15 Apr 2008)
Log Message: ----------- Don't eat the preceding [|{=]
Modified Paths: -------------- trunk/pywikipedia/commonsdelinker/delinker.py
Modified: trunk/pywikipedia/commonsdelinker/delinker.py =================================================================== --- trunk/pywikipedia/commonsdelinker/delinker.py 2008-04-13 14:08:44 UTC (rev 5218) +++ trunk/pywikipedia/commonsdelinker/delinker.py 2008-04-15 09:30:16 UTC (rev 5219) @@ -267,7 +267,7 @@ # likely embedded in a complicated template. hook = 'complex' r_templates = ur'(?s)({{.*?}})' - r_complicated = u'(?s)[|{=]\s*((?:%s)?)%s' % (r_namespace, r_image) + r_complicated = u'(?s)(?<=[|{=])\s*((?:%s)?)%s' % (r_namespace, r_image) def template_replacer(match): return re.sub(r_complicated, simple_replacer, match.group(1))
pywikipedia-l@lists.wikimedia.org