浏览代码

Render Markdown blog posts in the RSS feed

pull/2/head
父节点
当前提交
afa783386b
共有 1 个文件被更改,包括 12 次插入1 次删除
  1. +12
    -1
      rophako/modules/blog.py

+ 12
- 1
rophako/modules/blog.py 查看文件

@@ -318,10 +318,21 @@ def rss():
post = Blog.get_entry(post_id)
item = doc.createElement("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, [
["title", post["subject"]],
["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"]))],
])



正在加载...
取消
保存