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(