1
0
Fork 0
forked from github/pelican

Split post content on all types of line endings for adding paragraph tags

This commit is contained in:
David Beitey 2012-11-04 14:08:58 +10:00
commit 528747684d
2 changed files with 3 additions and 1 deletions

View file

@ -5,6 +5,8 @@ Release history
================
* Improve handling of links to intra-site resources
* Ensure WordPress import adds paragraphs in for all types of line endings
in post content.
3.0 (2012-08-08)
==================

View file

@ -236,7 +236,7 @@ def fields2pelican(fields, out_markup, output_path, dircat=False, strip_raw=Fals
with open(html_filename, 'w', encoding='utf-8') as fp:
# Replace newlines with paragraphs wrapped with <p> so
# HTML is valid before conversion
paragraphs = content.split('\n\n')
paragraphs = content.splitlines()
paragraphs = [u'<p>{0}</p>'.format(p) for p in paragraphs]
new_content = ''.join(paragraphs)