forked from github/pelican
Keep raw metadata text (but for summary)
This commit is contained in:
parent
cbc609c8f0
commit
9c4b40fd35
3 changed files with 6 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue