mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Avoid growing MD_EXTENSIONS list with each instantiation of the Markdown
reader.
This commit is contained in:
parent
1fad70e5b9
commit
86595555d5
1 changed files with 1 additions and 7 deletions
|
|
@ -186,11 +186,6 @@ class MarkdownReader(BaseReader):
|
|||
enabled = bool(Markdown)
|
||||
file_extensions = ['md', 'markdown', 'mkd', 'mdown']
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(MarkdownReader, self).__init__(*args, **kwargs)
|
||||
self.extensions = self.settings['MD_EXTENSIONS']
|
||||
self.extensions.append('meta')
|
||||
|
||||
def _parse_metadata(self, meta):
|
||||
"""Return the dict containing document metadata"""
|
||||
output = {}
|
||||
|
|
@ -208,8 +203,7 @@ class MarkdownReader(BaseReader):
|
|||
|
||||
def read(self, source_path):
|
||||
"""Parse content and metadata of markdown files"""
|
||||
|
||||
self._md = Markdown(extensions=self.extensions)
|
||||
self._md = Markdown(extensions=self.extensions + ['meta'])
|
||||
with pelican_open(source_path) as text:
|
||||
content = self._md.convert(text)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue