mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Add a way to use Typogrify to enhance the generated HTML.
This commit is contained in:
parent
fbf89687cc
commit
d43bd1dcb8
5 changed files with 41 additions and 2 deletions
4
tests/content/article.rst
Normal file
4
tests/content/article.rst
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
Article title
|
||||
#############
|
||||
|
||||
This is some content. With some stuff to "typogrify".
|
||||
|
|
@ -33,3 +33,20 @@ class RstReaderTest(unittest.TestCase):
|
|||
|
||||
for key, value in expected.items():
|
||||
self.assertEquals(value, metadata[key], key)
|
||||
|
||||
def test_typogrify(self):
|
||||
# if nothing is specified in the settings, the content should be
|
||||
# unmodified
|
||||
content, _ = readers.read_file(_filename('article.rst'))
|
||||
expected = "<p>This is some content. With some stuff to "\
|
||||
""typogrify".</p>\n"
|
||||
|
||||
self.assertEqual(content, expected)
|
||||
|
||||
# otherwise, typogrify should be applied
|
||||
content, _ = readers.read_file(_filename('article.rst'),
|
||||
settings={'TYPOGRIFY': True})
|
||||
expected = "<p>This is some content. With some stuff to "\
|
||||
"“typogrify”.</p>\n"
|
||||
|
||||
self.assertEqual(content, expected)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue