From 6577efc8f466acf8f6e639528959e2915a7f9413 Mon Sep 17 00:00:00 2001 From: Aaron Kavlie Date: Wed, 18 Apr 2012 00:20:54 -0700 Subject: [PATCH] Wrap paragraphs in

tags --- pelican/tools/pelican_import.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index a4d64c67..01253960 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -17,7 +17,7 @@ def wp2fields(xml): from BeautifulSoup import BeautifulStoneSoup except ImportError: error = 'Missing dependency ' + \ - '"BeautifulSoup" required to import Wordpress files.' + '"BeautifulSoup" required to import Wordpress XML files.' sys.exit(error) xmlfile = open(xml, encoding='utf-8').read() @@ -226,7 +226,10 @@ def fields2pelican(fields, out_markup, output_path, dircat=False): with open(html_filename, 'w', encoding='utf-8') as fp: # Replace simple newlines with
+newline so that the HTML file # represents the original post more accurately - content = content.replace("\n", "
\n") + paragraphs = content.split('\n\n') + paragraphs = ['

%s

' % p for p in paragraphs] + new_content = ''.join(paragraphs) + fp.write(content) cmd = 'pandoc --normalize --reference-links --from=html --to={0} -o "{1}" "{2}"'.format(