diff options
Diffstat (limited to 'src/Text/Pandoc/Writers/Docbook.hs')
-rw-r--r-- | src/Text/Pandoc/Writers/Docbook.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Docbook.hs b/src/Text/Pandoc/Writers/Docbook.hs index a53c3fb86..2706f3334 100644 --- a/src/Text/Pandoc/Writers/Docbook.hs +++ b/src/Text/Pandoc/Writers/Docbook.hs @@ -87,9 +87,12 @@ elementToDocbook opts (Sec _ _num id' title elements) = let elements' = if null elements then [Blk (Para [])] else elements - in inTags True "section" [("id",id')] $ + tag = if writerChapters opts + then "chapter" + else "section" + in inTags True tag [("id",id')] $ inTagsSimple "title" (inlinesToDocbook opts title) $$ - vcat (map (elementToDocbook opts) elements') + vcat (map (elementToDocbook opts{ writerChapters = False }) elements') -- | Convert a list of Pandoc blocks to Docbook. blocksToDocbook :: WriterOptions -> [Block] -> Doc |