diff options
author | Florian Klink <flokli@flokli.de> | 2019-10-30 16:51:33 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-10-30 08:51:33 -0700 |
commit | c6e936dec2fc0f0e4d15b7c6f7c4ed6934dd233a (patch) | |
tree | 859287bf1c5e4e0e9d46e4ccc4941c6016b4da5b /test/docbook-chapter.docbook | |
parent | 080a3cdaebe074f588b9f6266d09e745f430487c (diff) | |
download | pandoc-c6e936dec2fc0f0e4d15b7c6f7c4ed6934dd233a.tar.gz |
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>
Diffstat (limited to 'test/docbook-chapter.docbook')
-rw-r--r-- | test/docbook-chapter.docbook | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/docbook-chapter.docbook b/test/docbook-chapter.docbook new file mode 100644 index 000000000..68bb60e02 --- /dev/null +++ b/test/docbook-chapter.docbook @@ -0,0 +1,30 @@ +<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" + "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> +<!-- This matches the example from +https://tdg.docbook.org/tdg/4.5/section.html, sans sectioninfo and subtitle, as +they're currently not supported --> +<chapter><title>Test Chapter</title> +<para>This chapter uses recursive sections.</para> +<section> +<title>Like a Sect1</title> +<para>This section is like a Sect1.</para> +<section><title>Like a Sect2</title> +<para>This section is like a Sect2.</para> +<section><title>Like a Sect3</title> +<para>This section is like a Sect3.</para> +<section><title>Like a Sect4</title> +<para>This section is like a Sect4.</para> +<section><title>Like a Sect5</title> +<para>This section is like a Sect5.</para> +<section><title>Would be like a Sect6</title> +<para>This section would be like a Sect6, if there was one.</para> +<section><title>Would be like a Sect7</title> +<para>This section would be like a Sect7, if there was one.</para> +</section> +</section> +</section> +</section> +</section> +</section> +</section> +</chapter> |