feed.write('<description>Latest news and happenings with Samba and Samba development.</description>\n')
feed.write('<link>http://news.samba.org/</link>\n\n')
-# Characters to avoid as "undefined entities" in XML
-ents = { '—' : '--' }
-
count = 10
for date in post_dates:
item_text = all_stories[date]
- if '&' in item_text and ';' in item_text:
- for ent in ents.keys():
- item_text = item_text.replace(ent, ents[ent])
+ # Encode *all* ampersands
+ if '&' in item_text:
+ item_text = item_text.replace('&', '&')
if count > 0:
title = re.search('(?<=\"\>).+(?=\<\/a)', item_text)