From 0f49886db50c07b050f1147896c37d959046988b Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 3 Jun 2012 22:45:21 +0200 Subject: Add possible nl2br option With the nl2br option newline characters should be changed to `
'. --- aggregator/management/commands/loadfeeds.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aggregator/management/commands/loadfeeds.py b/aggregator/management/commands/loadfeeds.py index fa493c1..f826312 100644 --- a/aggregator/management/commands/loadfeeds.py +++ b/aggregator/management/commands/loadfeeds.py @@ -84,6 +84,9 @@ class Command(BaseCommand): if feedoptions['markdown']: content = markdown.markdown(content) + if feedoptions.get('nl2br'): + content = re.sub('\n', '
\n', content) + post = Post(post_id=entry.id, title=entry.title, category=feedoptions['category'], -- cgit v1.2.3-54-g00ecf