pandoc/test/docbook-chapter.native
Florian Klink c6e936dec2 docbook reader: fix nesting of chapters and sections (#5864)
* Set dbBook to true when traversing a chapter too.
  Currently, a `<title/>` in a chapter and in a `<section/>` below that
  chapter have the same level if they're not inside a `<book/>`.

  This can happen in a multi-file book project. Also see the example at
  https://tdg.docbook.org/tdg/4.5/chapter.html

  Co-authored-by: Félix Baylac-Jacqué <felix@alternativebit.fr>

* Add docbook-chapter test

  This tests nested `<section/>` and makes sure `<title/>` in the first
  `<section/>` below `<chapter/>` is one level deeper than the `<chapter/>`'s
  `<title/>`, also when not inside a `<book/>`.

  Co-authored-by: Félix Baylac-Jacqué <felix@alternativebit.fr>
2019-10-30 08:51:33 -07:00

17 lines
1.6 KiB
Text

Pandoc (Meta {unMeta = fromList []})
[Header 1 ("",[],[]) [Str "Test",Space,Str "Chapter"]
,Para [Str "This",Space,Str "chapter",Space,Str "uses",Space,Str "recursive",Space,Str "sections."]
,Header 2 ("",[],[]) [Str "Like",Space,Str "a",Space,Str "Sect1"]
,Para [Str "This",Space,Str "section",Space,Str "is",Space,Str "like",Space,Str "a",Space,Str "Sect1."]
,Header 3 ("",[],[]) [Str "Like",Space,Str "a",Space,Str "Sect2"]
,Para [Str "This",Space,Str "section",Space,Str "is",Space,Str "like",Space,Str "a",Space,Str "Sect2."]
,Header 4 ("",[],[]) [Str "Like",Space,Str "a",Space,Str "Sect3"]
,Para [Str "This",Space,Str "section",Space,Str "is",Space,Str "like",Space,Str "a",Space,Str "Sect3."]
,Header 5 ("",[],[]) [Str "Like",Space,Str "a",Space,Str "Sect4"]
,Para [Str "This",Space,Str "section",Space,Str "is",Space,Str "like",Space,Str "a",Space,Str "Sect4."]
,Header 6 ("",[],[]) [Str "Like",Space,Str "a",Space,Str "Sect5"]
,Para [Str "This",Space,Str "section",Space,Str "is",Space,Str "like",Space,Str "a",Space,Str "Sect5."]
,Header 7 ("",[],[]) [Str "Would",Space,Str "be",Space,Str "like",Space,Str "a",Space,Str "Sect6"]
,Para [Str "This",Space,Str "section",Space,Str "would",Space,Str "be",Space,Str "like",Space,Str "a",Space,Str "Sect6,",Space,Str "if",Space,Str "there",Space,Str "was",Space,Str "one."]
,Header 8 ("",[],[]) [Str "Would",Space,Str "be",Space,Str "like",Space,Str "a",Space,Str "Sect7"]
,Para [Str "This",Space,Str "section",Space,Str "would",Space,Str "be",Space,Str "like",Space,Str "a",Space,Str "Sect7,",Space,Str "if",Space,Str "there",Space,Str "was",Space,Str "one."]]