FIX: Standardizing "extentions" to "extensions"

This commit is contained in:
Stéphane Bunel 2012-10-03 22:29:59 +02:00
commit ee46becaf9
4 changed files with 9 additions and 9 deletions

View file

@ -128,13 +128,13 @@ class MarkdownReader(Reader):
def read(self, filename):
"""Parse content and metadata of markdown files"""
markdown_extentions = self.settings.get('MARKDOWN_EXTENTIONS', [])
if isinstance(markdown_extentions, (str, unicode)):
markdown_extentions = [m.strip() for m in
markdown_extentions.split(',')]
markdown_extensions = self.settings.get('MARKDOWN_EXTENsIONS', [])
if isinstance(markdown_extensions, (str, unicode)):
markdown_extensions = [m.strip() for m in
markdown_extensions.split(',')]
text = pelican_open(filename)
md = Markdown(extensions=set(
self.extensions + markdown_extentions + ['meta']))
self.extensions + markdown_extensions + ['meta']))
content = md.convert(text)
metadata = {}

View file

@ -75,7 +75,7 @@ _DEFAULT_CONFIG = {'PATH': '.',
'SUMMARY_MAX_LENGTH': 50,
'WEBASSETS': False,
'PLUGINS': [],
'MARKDOWN_EXTENTIONS': [ 'toc', ],
'MARKDOWN_EXTENSIONS': ['toc', ],
}

View file

@ -69,7 +69,7 @@ class TestArticlesGenerator(unittest.TestCase):
[u'Article title', 'published', 'Default', 'article'],
[u'Article with template', 'published', 'Default', 'custom'],
[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 an article with category !', 'published', 'yeah', 'article'],
[u'This is an article without category !', 'published', 'Default', 'article'],

View file

@ -95,8 +95,8 @@ class MdReaderTest(unittest.TestCase):
def test_article_with_markdown_markup_extension(self):
# test to ensure the markdown markup extension is being processed as expected
reader = readers.MarkdownReader({})
reader.settings.update(dict(MARKDOWN_EXTENTIONS=['toc']))
content, metadata = reader.read(_filename('article_with_markdown_markup_extentions.md'))
reader.settings.update(dict(MARKDOWN_EXTENSIONS=['toc']))
content, metadata = reader.read(_filename('article_with_markdown_markup_extensions.md'))
expected = '<div class="toc">\n'\
'<ul>\n'\
'<li><a href="#level1">Level1</a><ul>\n'\