Accept mdown file extension for Markdown files.

This extension is sometimes used for Markdown files and is the default
for a few editors, such as Sublime Text.
This commit is contained in:
Emily Strickland 2013-04-17 21:14:52 -07:00
commit 08f27e0134
5 changed files with 25 additions and 6 deletions

View file

@ -149,7 +149,7 @@ class RstReader(Reader):
class MarkdownReader(Reader):
enabled = bool(Markdown)
file_extensions = ['md', 'markdown', 'mkd']
file_extensions = ['md', 'markdown', 'mkd', 'mdown']
default_extensions = ['codehilite(css_class=highlight)', 'extra']
def __init__(self, *args, **kwargs):

View file

@ -0,0 +1,10 @@
title: Test mdown File
category: test
Test Markdown File Header
=========================
Used for pelican test
---------------------
This is another markdown test file. Uses the mdown extension.

View file

@ -172,6 +172,14 @@ class MdReaderTest(unittest.TestCase):
" test</h2>\n<p>This is another markdown test file. Uses"
" the markdown extension.</p>")
self.assertEqual(content, expected)
# test to ensure the mdown file extension is being processed by the
# correct reader
content, metadata = reader.read(
_path('article_with_mdown_extension.mdown'))
expected = ("<h1>Test Markdown File Header</h1>\n<h2>Used for pelican"
" test</h2>\n<p>This is another markdown test file. Uses"
" the mdown extension.</p>")
self.assertEqual(content, expected)
@unittest.skipUnless(readers.Markdown, "markdown isn't installed")
def test_article_with_markdown_markup_extension(self):