mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #306 from mbowcock/master
Add output markup option to importer doc and multiple file extensions to file reader
This commit is contained in:
commit
0fe1453c50
6 changed files with 52 additions and 5 deletions
10
tests/content/article_with_md_extension.md
Normal file
10
tests/content/article_with_md_extension.md
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
title: Test md File
|
||||
category: test
|
||||
|
||||
Test Markdown File Header
|
||||
=========================
|
||||
|
||||
Used for pelican test
|
||||
---------------------
|
||||
|
||||
The quick brown fox jumped over the lazy dog's back.
|
||||
10
tests/content/article_with_mkd_extension.mkd
Normal file
10
tests/content/article_with_mkd_extension.mkd
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
title: Test mkd File
|
||||
category: test
|
||||
|
||||
Test Markdown File Header
|
||||
=========================
|
||||
|
||||
Used for pelican test
|
||||
---------------------
|
||||
|
||||
This is another markdown test file. Uses the mkd extension.
|
||||
|
|
@ -61,3 +61,25 @@ class RstReaderTest(unittest.TestCase):
|
|||
self.assertEqual(content, expected)
|
||||
except ImportError:
|
||||
return unittest.skip('need the typogrify distribution')
|
||||
|
||||
class MdReaderTest(unittest.TestCase):
|
||||
|
||||
def test_article_with_md_extention(self):
|
||||
# test to ensure the md extension is being processed by the correct reader
|
||||
reader = readers.MarkdownReader({})
|
||||
content, metadata = reader.read(_filename('article_with_md_extension.md'))
|
||||
expected = "<h1>Test Markdown File Header</h1>\n"\
|
||||
"<h2>Used for pelican test</h2>\n"\
|
||||
"<p>The quick brown fox jumped over the lazy dog's back.</p>"
|
||||
|
||||
self.assertEqual(content, expected)
|
||||
|
||||
def test_article_with_mkd_extension(self):
|
||||
# test to ensure the mkd extension is being processed by the correct reader
|
||||
reader = readers.MarkdownReader({})
|
||||
content, metadata = reader.read(_filename('article_with_mkd_extension.mkd'))
|
||||
expected = "<h1>Test Markdown File Header</h1>\n"\
|
||||
"<h2>Used for pelican test</h2>\n"\
|
||||
"<p>This is another markdown test file. Uses the mkd extension.</p>"
|
||||
|
||||
self.assertEqual(content, expected)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue