From 44e4729a23786fc98a6eb802aa30c3646ba0a216 Mon Sep 17 00:00:00 2001 From: Gregory Soutade Date: Sun, 5 Jan 2014 22:19:19 +0100 Subject: [PATCH] Forgot to update Atom & RSS generators for Markdown support --- generators/atom.py | 4 ++++ generators/rss.py | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/generators/atom.py b/generators/atom.py index 0cbc1ed..06a45e7 100644 --- a/generators/atom.py +++ b/generators/atom.py @@ -24,6 +24,7 @@ from dynastie.generators.generator import DynastieGenerator from dynastie.generators.rss import RSS from xml.dom.minidom import getDOMImplementation from django.db import models +from dynastie.generators import markdown2 class Atom(RSS): @@ -80,6 +81,9 @@ class Atom(RSS): post_content = '' f.close() + if post.content_format == Post.CONTENT_TEXT: + post_content = markdown2.markdown(post_content) + self.appendElement(dom, item, 'summary', post_content, {'type':'html'}) self.appendElement(dom, item, 'content', post_content, {'type':'html'}) root.appendChild(item) diff --git a/generators/rss.py b/generators/rss.py index d851fd6..b399931 100644 --- a/generators/rss.py +++ b/generators/rss.py @@ -23,6 +23,8 @@ import xml from dynastie.generators.generator import DynastieGenerator from xml.dom.minidom import getDOMImplementation from django.db import models +from dynastie.generators import markdown2 + class RSS(DynastieGenerator): @@ -78,6 +80,9 @@ class RSS(DynastieGenerator): post_content = f.read() f.close() + if post.content_format == Post.CONTENT_TEXT: + post_content = markdown2.markdown(post_content) + self.appendElement(dom, item, 'description', '') try: