Render Markdown blog posts in the RSS feed
This commit is contained in:
parent
74a6534762
commit
afa783386b
|
@ -318,10 +318,21 @@ def rss():
|
||||||
post = Blog.get_entry(post_id)
|
post = Blog.get_entry(post_id)
|
||||||
item = doc.createElement("item")
|
item = doc.createElement("item")
|
||||||
channel.appendChild(item)
|
channel.appendChild(item)
|
||||||
|
|
||||||
|
# Render the body.
|
||||||
|
if post["format"] == "markdown":
|
||||||
|
post["rendered_body"] = render_markdown(post["body"])
|
||||||
|
else:
|
||||||
|
post["rendered_body"] = post["body"]
|
||||||
|
|
||||||
|
# Render emoticons.
|
||||||
|
if post["emoticons"]:
|
||||||
|
post["rendered_body"] = Emoticons.render(post["rendered_body"])
|
||||||
|
|
||||||
xml_add_text_tags(doc, item, [
|
xml_add_text_tags(doc, item, [
|
||||||
["title", post["subject"]],
|
["title", post["subject"]],
|
||||||
["link", url_for("blog.entry", fid=post["fid"], _external=True)],
|
["link", url_for("blog.entry", fid=post["fid"], _external=True)],
|
||||||
["description", post["body"]],
|
["description", post["rendered_body"]],
|
||||||
["pubDate", time.strftime(rss_time, time.gmtime(post["time"]))],
|
["pubDate", time.strftime(rss_time, time.gmtime(post["time"]))],
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user