Fix markup for single-paragraph summary in reST metadata

This commit is contained in:
Mike Yumatov 2012-03-25 21:39:41 +04:00
commit 4df6179954
2 changed files with 7 additions and 2 deletions

View file

@ -43,6 +43,10 @@ class Reader(object):
class _FieldBodyTranslator(HTMLTranslator):
def __init__(self, document):
HTMLTranslator.__init__(self, document)
self.compact_p = None
def astext(self):
return ''.join(self.body)

View file

@ -23,8 +23,9 @@ class RstReaderTest(unittest.TestCase):
'category': 'yeah',
'author': u'Alexis Métaireau',
'title': 'This is a super article !',
'summary': 'Multi-line metadata should be supported\nas well as'\
' <strong>inline markup</strong>.',
'summary': u'<p class="first last">Multi-line metadata should be'\
u' supported\nas well as <strong>inline'\
u' markup</strong>.</p>\n',
'date': datetime.datetime(2010, 12, 2, 10, 14),
'tags': ['foo', 'bar', 'foobar'],
'custom_field': 'http://notmyidea.org',