Skip to content

Commit

Permalink
Merge pull request #3114 from mart-e/import-markdown-wp
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmayer committed Jun 4, 2023
2 parents bbbc96c + 219c01a commit 1b360ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pelican/tests/test_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def r(f):
self.posts)
with temporary_folder() as temp:
md = [r(f) for f in silent_f2p(test_post, 'markdown', temp)][0]
sample_line = re.search(r'- This is a code sample', md).group(0)
sample_line = re.search(r'- This is a code sample', md).group(0)
code_line = re.search(r'\s+a = \[1, 2, 3\]', md).group(0)
self.assertTrue(sample_line.rindex('This') < code_line.rindex('a'))

Expand Down
7 changes: 5 additions & 2 deletions pelican/tools/pelican_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,12 +839,15 @@ def fields2pelican(
if pandoc_version >= (1, 16) else '--no-wrap'
cmd = ('pandoc --normalize {0} --from=html'
' --to={1} {2} -o "{3}" "{4}"')
cmd = cmd.format(parse_raw, out_markup, wrap_none,
cmd = cmd.format(parse_raw,
out_markup if out_markup != 'markdown' else "gfm",
wrap_none,
out_filename, html_filename)
else:
from_arg = '-f html+raw_html' if not strip_raw else '-f html'
cmd = ('pandoc {0} --to={1}-smart --wrap=none -o "{2}" "{3}"')
cmd = cmd.format(from_arg, out_markup,
cmd = cmd.format(from_arg,
out_markup if out_markup != 'markdown' else "gfm",
out_filename, html_filename)

try:
Expand Down

0 comments on commit 1b360ac

Please sign in to comment.