Revision: 4010 Author: wikipedian Date: 2007-08-09 03:25:53 +0000 (Thu, 09 Aug 2007)
Log Message: ----------- preserve whitespace
Modified Paths: -------------- trunk/pywikipedia/template.py
Modified: trunk/pywikipedia/template.py =================================================================== --- trunk/pywikipedia/template.py 2007-08-08 20:56:59 UTC (rev 4009) +++ trunk/pywikipedia/template.py 2007-08-09 03:25:53 UTC (rev 4010) @@ -128,6 +128,7 @@ # TODO: check site.nocapitalize() templateName = self.template.titleWithoutNamespace() if wikipedia.getSite().nocapitalize: + # FIXME old = self.old else: templateName = '[' + templateName[0].upper() + templateName[0].lower() + ']' + templateName[1:] @@ -288,7 +289,7 @@ else: pattern = re.escape(old) pattern = re.sub('_|\\ ', '[_ ]', pattern) - templateRegex = re.compile(r'{{ *([Tt]emplate:|[mM][sS][gG]:)?' + pattern + '\s*(?P<parameters>|.+?|) *}}', re.DOTALL) + templateRegex = re.compile(r'{{ *([Tt]emplate:|[mM][sS][gG]:)?' + pattern + '(?P<parameters>\s*|.+?|) *}}', re.DOTALL)
if self.remove: replacements.append((templateRegex, ''))