diff options
author | Tom Willemsen | 2012-06-03 22:45:21 +0200 |
---|---|---|
committer | Tom Willemsen | 2012-06-03 22:45:21 +0200 |
commit | 0f49886db50c07b050f1147896c37d959046988b (patch) | |
tree | 26368beea391b81b7cb617253706ba430b24a9ff /aggregator/management/commands/loadfeeds.py | |
parent | 9caad3f69f9086fd5dd5a3adf9af8925bb75553e (diff) | |
download | ryuslash.org-0f49886db50c07b050f1147896c37d959046988b.tar.gz ryuslash.org-0f49886db50c07b050f1147896c37d959046988b.zip |
Add possible nl2br option
With the nl2br option newline characters should be changed to `<br/>'.
Diffstat (limited to 'aggregator/management/commands/loadfeeds.py')
-rw-r--r-- | aggregator/management/commands/loadfeeds.py | 3 |
1 files changed, 3 insertions, 0 deletions
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', '</br>\n', content) + post = Post(post_id=entry.id, title=entry.title, category=feedoptions['category'], |