Docbook writer: Hierarchicalize block content in metadata.

Previously headers just disappeared from block-level metadata
when it was used in templates.

Now we apply the 'hierarchicalize' transformation.

Note that a block headed by a level-2 header will turn into
a `<sect1>` element.
This commit is contained in:
John MacFarlane 2013-11-19 12:01:52 -08:00
parent 4566309dd5
commit c226a57eaa

View file

@ -85,8 +85,9 @@ writeDocbook opts (Pandoc meta blocks) =
auths' = map (authorToDocbook opts) $ docAuthors meta
meta' = B.setMeta "author" auths' meta
Just metadata = metaToJSON opts
(Just . render colwidth . blocksToDocbook opts)
(Just . render colwidth . inlinesToDocbook opts)
(Just . render colwidth . (vcat .
(map (elementToDocbook opts' startLvl)) . hierarchicalize))
(Just . render colwidth . inlinesToDocbook opts')
meta'
main = render' $ vcat (map (elementToDocbook opts' startLvl) elements)
context = defField "body" main