diff --git a/pelican/readers.py b/pelican/readers.py
index 1e00aefa..20f391eb 100644
--- a/pelican/readers.py
+++ b/pelican/readers.py
@@ -462,10 +462,13 @@ class Readers(object):
find_empty_alt(content, path)
# eventually filter the content with typogrify if asked so
- if content and self.settings['TYPOGRIFY']:
+ if self.settings['TYPOGRIFY']:
from typogrify.filters import typogrify
- content = typogrify(content)
- metadata['title'] = typogrify(metadata['title'])
+ if content:
+ content = typogrify(content)
+ metadata['title'] = typogrify(metadata['title'])
+ if 'summary' in metadata:
+ metadata['summary'] = typogrify(metadata['summary'])
if context_signal:
logger.debug('signal {}.send({}, Multi-line metadata should be'
' supported\nas well as inline'
- ' markup.
Multi-line metadata should be' + ' supported\nas well as inline' + ' markup and stuff to "typogrify' + '"...
\n') + + self.assertEqual(page.metadata['summary'], expected) + + try: + # otherwise, typogrify should be applied + page = self.read_file(path='article_with_metadata.rst', + TYPOGRIFY=True) + expected = ('Multi-line metadata should be' + ' supported\nas well as inline' + ' markup and stuff to "typogrify' + '"…
\n') + + self.assertEqual(page.metadata['summary'], expected) + except ImportError: + return unittest.skip('need the typogrify distribution') + class MdReaderTest(ReaderTest):