[Pywikipedia-l] SVN: [5341] trunk/pywikipedia/noreferences.py

wikipedian at svn.wikimedia.org wikipedian at svn.wikimedia.org
Fri May 9 10:56:35 UTC 2008


Revision: 5341
Author:   wikipedian
Date:     2008-05-09 10:56:35 +0000 (Fri, 09 May 2008)

Log Message:
-----------
bugfix: the <references/> tag can now have a "group" attribute.

Modified Paths:
--------------
    trunk/pywikipedia/noreferences.py

Modified: trunk/pywikipedia/noreferences.py
===================================================================
--- trunk/pywikipedia/noreferences.py	2008-05-08 19:49:52 UTC (rev 5340)
+++ trunk/pywikipedia/noreferences.py	2008-05-09 10:56:35 UTC (rev 5341)
@@ -198,7 +198,8 @@
         """
         self.xmlFilename = xmlFilename
         self.refR = re.compile('</ref>', re.IGNORECASE)
-        self.referencesR = re.compile('<references */>', re.IGNORECASE)
+        # The references tab can contain additional spaces and a group attribute.
+        self.referencesR = re.compile('<references.*?/>', re.IGNORECASE)
 
     def __iter__(self):
         import xmlreader
@@ -215,7 +216,7 @@
         self.always = always
         self.site = wikipedia.getSite()
         self.refR = re.compile('</ref>', re.IGNORECASE)
-        self.referencesR = re.compile('<references */>', re.IGNORECASE)
+        self.referencesR = re.compile('<references.*?/>', re.IGNORECASE)
         try:
             self.referencesTemplates = referencesTemplates[wikipedia.getSite().family.name][wikipedia.getSite().lang]
         except KeyError:





More information about the Pywikipedia-l mailing list