mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
FIX: Standardizing "extentions" to "extensions"
This commit is contained in:
parent
d9d58b0510
commit
ee46becaf9
4 changed files with 9 additions and 9 deletions
|
|
@ -128,13 +128,13 @@ class MarkdownReader(Reader):
|
||||||
|
|
||||||
def read(self, filename):
|
def read(self, filename):
|
||||||
"""Parse content and metadata of markdown files"""
|
"""Parse content and metadata of markdown files"""
|
||||||
markdown_extentions = self.settings.get('MARKDOWN_EXTENTIONS', [])
|
markdown_extensions = self.settings.get('MARKDOWN_EXTENsIONS', [])
|
||||||
if isinstance(markdown_extentions, (str, unicode)):
|
if isinstance(markdown_extensions, (str, unicode)):
|
||||||
markdown_extentions = [m.strip() for m in
|
markdown_extensions = [m.strip() for m in
|
||||||
markdown_extentions.split(',')]
|
markdown_extensions.split(',')]
|
||||||
text = pelican_open(filename)
|
text = pelican_open(filename)
|
||||||
md = Markdown(extensions=set(
|
md = Markdown(extensions=set(
|
||||||
self.extensions + markdown_extentions + ['meta']))
|
self.extensions + markdown_extensions + ['meta']))
|
||||||
content = md.convert(text)
|
content = md.convert(text)
|
||||||
|
|
||||||
metadata = {}
|
metadata = {}
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ _DEFAULT_CONFIG = {'PATH': '.',
|
||||||
'SUMMARY_MAX_LENGTH': 50,
|
'SUMMARY_MAX_LENGTH': 50,
|
||||||
'WEBASSETS': False,
|
'WEBASSETS': False,
|
||||||
'PLUGINS': [],
|
'PLUGINS': [],
|
||||||
'MARKDOWN_EXTENTIONS': [ 'toc', ],
|
'MARKDOWN_EXTENSIONS': ['toc', ],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ class TestArticlesGenerator(unittest.TestCase):
|
||||||
[u'Article title', 'published', 'Default', 'article'],
|
[u'Article title', 'published', 'Default', 'article'],
|
||||||
[u'Article with template', 'published', 'Default', 'custom'],
|
[u'Article with template', 'published', 'Default', 'custom'],
|
||||||
[u'Test md File', 'published', 'test', 'article'],
|
[u'Test md File', 'published', 'test', 'article'],
|
||||||
[u'Test Markdown extentions', 'published', u'Default', 'article'],
|
[u'Test Markdown extensions', 'published', u'Default', 'article'],
|
||||||
[u'This is a super article !', 'published', 'Yeah', 'article'],
|
[u'This is a super article !', 'published', 'Yeah', 'article'],
|
||||||
[u'This is an article with category !', 'published', 'yeah', 'article'],
|
[u'This is an article with category !', 'published', 'yeah', 'article'],
|
||||||
[u'This is an article without category !', 'published', 'Default', 'article'],
|
[u'This is an article without category !', 'published', 'Default', 'article'],
|
||||||
|
|
|
||||||
|
|
@ -95,8 +95,8 @@ class MdReaderTest(unittest.TestCase):
|
||||||
def test_article_with_markdown_markup_extension(self):
|
def test_article_with_markdown_markup_extension(self):
|
||||||
# test to ensure the markdown markup extension is being processed as expected
|
# test to ensure the markdown markup extension is being processed as expected
|
||||||
reader = readers.MarkdownReader({})
|
reader = readers.MarkdownReader({})
|
||||||
reader.settings.update(dict(MARKDOWN_EXTENTIONS=['toc']))
|
reader.settings.update(dict(MARKDOWN_EXTENSIONS=['toc']))
|
||||||
content, metadata = reader.read(_filename('article_with_markdown_markup_extentions.md'))
|
content, metadata = reader.read(_filename('article_with_markdown_markup_extensions.md'))
|
||||||
expected = '<div class="toc">\n'\
|
expected = '<div class="toc">\n'\
|
||||||
'<ul>\n'\
|
'<ul>\n'\
|
||||||
'<li><a href="#level1">Level1</a><ul>\n'\
|
'<li><a href="#level1">Level1</a><ul>\n'\
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue