forked from github/pelican
Update pelican_import.py
pelican-import: Move pandoc check inside loop, fixing #2448
This commit is contained in:
parent
3596e04639
commit
ded234467d
1 changed files with 7 additions and 8 deletions
|
|
@ -739,9 +739,8 @@ def download_attachments(output_path, urls):
|
|||
return locations
|
||||
|
||||
|
||||
def is_pandoc_needed(fields):
|
||||
in_markup_idx = 9
|
||||
return filter(lambda f: f[in_markup_idx] in ('html', 'wp-html'), fields)
|
||||
def is_pandoc_needed(in_markup):
|
||||
return in_markup in ('html', 'wp-html')
|
||||
|
||||
|
||||
def get_pandoc_version():
|
||||
|
|
@ -773,11 +772,6 @@ def fields2pelican(
|
|||
|
||||
pandoc_version = get_pandoc_version()
|
||||
|
||||
if is_pandoc_needed(fields) and not pandoc_version:
|
||||
error = ('Pandoc must be installed to complete the '
|
||||
'requested import action.')
|
||||
exit(error)
|
||||
|
||||
settings = read_settings()
|
||||
slug_subs = settings['SLUG_REGEX_SUBSTITUTIONS']
|
||||
|
||||
|
|
@ -785,6 +779,11 @@ def fields2pelican(
|
|||
kind, in_markup) in fields:
|
||||
if filter_author and filter_author != author:
|
||||
continue
|
||||
if is_pandoc_needed(in_markup) and not pandoc_version:
|
||||
error = ('Pandoc must be installed to complete the '
|
||||
'requested import action.')
|
||||
exit(error)
|
||||
|
||||
slug = not disable_slugs and filename or None
|
||||
|
||||
if wp_attach and attachments:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue