New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix 2798 #2799
Conversation
content_format = get_default_compiler( | ||
is_post, | ||
self.site.config['COMPILERS'], | ||
self.site.config['post_pages']) | ||
|
||
if content_format not in compiler_names: | ||
elif content_format not in compiler_names: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps that if
was there for a reason? (I can’t see it though.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked, this seems to work just as well :)
if extension in extensions: | ||
content_format = compiler | ||
|
||
elif not content_format and import_file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we could merge that and the first if into one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps, but it saves 3 lines of code at the cost of a non-stupid condition. I like stupid conditions.
Thanks for fixing this! |
Guess content format from path or imported file on
nikola new_post
Fixes #2798