1
0
Fork 0
forked from github/pelican

Keep raw metadata text (but for summary)

This commit is contained in:
Alexis Metaireau 2012-03-18 15:12:06 +01:00
commit 9c4b40fd35
3 changed files with 6 additions and 1 deletions

View file

@ -71,7 +71,10 @@ class RstReader(Reader):
if element.tagname == 'field': # custom fields (e.g. summary)
name_elem, body_elem = element.children
name = name_elem.astext()
value = render_node_to_html(document, body_elem)
if name == 'summary':
value = render_node_to_html(document, body_elem)
else:
value = body_elem.astext()
else: # standard fields (e.g. address)
name = element.tagname
value = element.astext()

View file

@ -9,3 +9,4 @@ This is a super article !
:summary:
Multi-line metadata should be supported
as well as **inline markup**.
:custom_field: http://notmyidea.org

View file

@ -30,6 +30,7 @@ class RstReaderTest(unittest.TestCase):
' <strong>inline markup</strong>.',
'date': datetime.datetime(2010, 12, 2, 10, 14),
'tags': ['foo', 'bar', 'foobar'],
'custom_field': 'http://notmyidea.org',
}
for key, value in expected.items():