1.1 --- a/macros/SharedContent.py Mon May 13 20:18:49 2013 +0200
1.2 +++ b/macros/SharedContent.py Tue May 14 00:53:38 2013 +0200
1.3 @@ -41,6 +41,9 @@
1.4 else:
1.5 return element.getAttribute("href")
1.6
1.7 +def need_content(show_content, tagname):
1.8 + return show_content in ("content", "description") and tagname in ("content", "description")
1.9 +
1.10 # Error classes.
1.11
1.12 class FeedError(Exception):
1.13 @@ -157,21 +160,29 @@
1.14 else:
1.15 channel_link = linktext(value, feed_type)
1.16
1.17 - elif feed_type == "atom" and show_content and tagname in ("content", "summary"):
1.18 + elif show_content and (
1.19 + feed_type == "atom" and tagname in ("content", "summary") or
1.20 + feed_type == "rss" and tagname == "description"):
1.21 +
1.22 events.expandNode(value)
1.23
1.24 # Obtain content where requested or, failing that, a
1.25 # summary.
1.26
1.27 - if update and (tagname == show_content or tagname == "summary" and not update.content):
1.28 - update.content_type = value.getAttribute("type") or "text"
1.29 - if update.content_type in ("xhtml", "application/xhtml+xml", "application/xml"):
1.30 - update.content = value.toxml()
1.31 + if update and (need_content(show_content, tagname) or tagname == "summary" and not update.content):
1.32 + if feed_type == "atom":
1.33 + update.content_type = value.getAttribute("type") or "text"
1.34 + if update.content_type in ("xhtml", "application/xhtml+xml", "application/xml"):
1.35 + update.content = value.toxml()
1.36 + else:
1.37 + update.content = text(value)
1.38 else:
1.39 + update.content_type = "html"
1.40 update.content = text(value)
1.41
1.42 elif feed_type == "atom" and tagname == "updated" or \
1.43 feed_type == "rss" and tagname == "pubDate":
1.44 +
1.45 events.expandNode(value)
1.46
1.47 if update: