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
Avoid Markdown 2.6 deprecations #1638
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,7 +101,11 @@ def load_source(name, path): | |
'PELICAN_CLASS': 'pelican.Pelican', | ||
'DEFAULT_DATE_FORMAT': '%a %d %B %Y', | ||
'DATE_FORMATS': {}, | ||
'MD_EXTENSIONS': ['codehilite(css_class=highlight)', 'extra'], | ||
'MD_EXTENSIONS': { | ||
'markdown.extensions.codehilite': {'css_class': 'highlight'}, | ||
'markdown.extensions.extra': {}, | ||
'markdown.extensions.meta': {}, | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. might be worth it to add meta to the default settings There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And since the dict is updated, does inclusion here obsolete the test for it in MarkdownReader? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great. 😃 |
||
'JINJA_EXTENSIONS': [], | ||
'JINJA_FILTERS': {}, | ||
'LOG_FILTER': [], | ||
|
@@ -362,6 +366,14 @@ def configure_settings(settings): | |
PATH_KEY) | ||
settings[PATH_KEY] = DEFAULT_CONFIG[PATH_KEY] | ||
|
||
# Save people from declaring MD_EXTENSIONS as a list rather than a dict | ||
if not isinstance(settings.get('MD_EXTENSIONS', {}), dict): | ||
logger.warning('The format of the MD_EXTENSIONS setting has ' | ||
'changed. It should now be a dict mapping ' | ||
'fully-qualified extension names to their ' | ||
'configurations. Falling back to the default.') | ||
settings['MD_EXTENSIONS'] = DEFAULT_CONFIG['MD_EXTENSIONS'] | ||
|
||
# Add {PAGE,ARTICLE}_PATHS to {ARTICLE,PAGE}_EXCLUDES | ||
mutually_exclusive = ('ARTICLE', 'PAGE') | ||
for type_1, type_2 in [mutually_exclusive, mutually_exclusive[::-1]]: | ||
|
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.
needs to be updated as well
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.
Thanks for catching that. 😅