svn commit: samba-web r596 - in trunk/scripts: .

deryck at samba.org deryck at samba.org
Sun Mar 20 14:31:47 GMT 2005


Author: deryck
Date: 2005-03-20 14:31:47 +0000 (Sun, 20 Mar 2005)
New Revision: 596

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba-web&rev=596

Log:

Clean out the <a> tags from RSS with a single regexp,
and find all possible forms of <a>, including across
multiple lines.

deryck

Modified:
   trunk/scripts/updateNews.py


Changeset:
Modified: trunk/scripts/updateNews.py
===================================================================
--- trunk/scripts/updateNews.py	2005-03-20 02:54:33 UTC (rev 595)
+++ trunk/scripts/updateNews.py	2005-03-20 14:31:47 UTC (rev 596)
@@ -212,10 +212,8 @@
         end = item_text.find('</p>') 
         descrip = item_text[begin:end]
         # Remove links to avoid malformed XML
-        a_begin = re.compile('<a href="(.*)">')
-        a_end = re.compile('</a>')
-        descrip = a_begin.sub('', descrip)
-        descrip = a_end.sub('', descrip)
+        atags = re.compile('<a href="(.*)">|</a>|<a>|<a|href="(.*)">')
+        descrip = atags.sub('', descrip)
 
         feed.write('<item>\n')
         feed.write('<title>' + title.group(0) + '</title>\n')



More information about the samba-cvs mailing list