From 528747684d171287cdadc5513a7f03d1d05e4786 Mon Sep 17 00:00:00 2001 From: David Beitey Date: Sun, 4 Nov 2012 14:08:58 +1000 Subject: [PATCH] Split post content on all types of line endings for adding paragraph tags --- docs/changelog.rst | 2 ++ pelican/tools/pelican_import.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 6cea6d93..4ba292a1 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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) ================== diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index fc28c6a4..bedd07f0 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -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

so # HTML is valid before conversion - paragraphs = content.split('\n\n') + paragraphs = content.splitlines() paragraphs = [u'

{0}

'.format(p) for p in paragraphs] new_content = ''.join(paragraphs)