mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
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:
parent
e03e17bc12
commit
08f27e0134
5 changed files with 25 additions and 6 deletions
|
|
@ -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):
|
||||
|
|
|
|||
10
pelican/tests/content/article_with_mdown_extension.mdown
Normal file
10
pelican/tests/content/article_with_mdown_extension.mdown
Normal 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.
|
||||
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue