git.iko.soy/typeable/pandoc
on master help sign in
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.

commitc226a57eaa7f1e9d4782c7ea3b56e72251a6487a authorJohn MacFarlane <jgm@berkeley.edu> dateTue 19 Nov 2013, 12:01 (13 years ago) parent4566309
1 file changed+3−2
src/Text/Pandoc/Writers/Docbook.hs+3−2
src/Text/Pandoc/Writers/Docbook.hs+3−2
@@ -85,8 +85,9 @@ writeDocbook opts (Pandoc meta blocks) =
8585 auths' = map (authorToDocbook opts) $ docAuthors meta
8686 meta' = B.setMeta "author" auths' meta
8787 Just metadata = metaToJSON opts
88− (Just . render colwidth . blocksToDocbook opts)
89− (Just . render colwidth . inlinesToDocbook opts)
88+ (Just . render colwidth . (vcat .
89+ (map (elementToDocbook opts' startLvl)) . hierarchicalize))
90+ (Just . render colwidth . inlinesToDocbook opts')
9091 meta'
9192 main = render' $ vcat (map (elementToDocbook opts' startLvl) elements)
9293 context = defField "body" main