forked from github/pelican
Split post content on all types of line endings for adding paragraph tags
This commit is contained in:
parent
bfc963a065
commit
528747684d
2 changed files with 3 additions and 1 deletions
|
|
@ -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)
|
||||
==================
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue