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:
parent
4566309dd5
commit
c226a57eaa
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue