diff options
author | John MacFarlane <jgm@berkeley.edu> | 2013-11-19 12:01:52 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2013-11-19 12:01:52 -0800 |
commit | c226a57eaa7f1e9d4782c7ea3b56e72251a6487a (patch) | |
tree | 1758fab6f6411a89902d198f3647d5eead3272e9 /src/Text | |
parent | 4566309dd5ab5c8e4d67a59011cdf27bd63ed0b0 (diff) | |
download | pandoc-c226a57eaa7f1e9d4782c7ea3b56e72251a6487a.tar.gz |
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.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/Docbook.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Docbook.hs b/src/Text/Pandoc/Writers/Docbook.hs index dad83d7bb..02d875be3 100644 --- a/src/Text/Pandoc/Writers/Docbook.hs +++ b/src/Text/Pandoc/Writers/Docbook.hs @@ -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 |