Skip to content

Commit

Permalink
Use SmartyPants to get better quotation markings.
Browse files Browse the repository at this point in the history
Fixes #31
  • Loading branch information
mblayman committed Sep 6, 2015
1 parent 8fa438f commit 69aa624
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Releases
Version 2.1, In Development
---------------------------

* Use the SmartyPants library to generate better quotation
marks for Markdown.

Version 2.0, Released July 25, 2015
-----------------------------------

Expand Down
4 changes: 4 additions & 0 deletions handroll/composers/md.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ class Foo(object):
.. code-block:: bash
$ pygmentize -S default -f html > pygments.css
The ``MarkdownComposer`` generates better typographical quotes
by using the SmartyPants library.
"""

EXTENSIONS = [
'codehilite',
'fenced_code',
'smarty',
]

def _generate_content(self, source):
Expand Down
6 changes: 6 additions & 0 deletions handroll/tests/test_composers.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ def test_composes_no_update(self):
composer.compose(catalog, source_file, outdir)
self.assertFalse(template.render.called)

def test_uses_smartypants(self):
source = '"quoted"'
composer = MarkdownComposer()
html = composer._generate_content(source)
self.assertEqual('<p>&ldquo;quoted&rdquo;</p>', html)


class TestReStructuredTextComposer(unittest.TestCase):

Expand Down

0 comments on commit 69aa624

Please sign in to comment.