aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-09-05 22:22:07 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-09-05 22:37:13 -0700
commit345b33762eb4cc6d57d74c76c4757a6166ee5c13 (patch)
tree78fc9d1448645c40bf2328e30e5fa91cd8d24377 /test
parent0534258780d495971bdae995c60002e231fe112a (diff)
downloadpandoc-345b33762eb4cc6d57d74c76c4757a6166ee5c13.tar.gz
Shared.hierarchicalize: improve handling of div and section structure.
Previously Divs were opaque to hierarchicalize, so headings inside divs didn't get into the table of contents, for example (#3057). Now hierarchicalize treats Divs as sections when appropriate. For example, these structures both yield a section and a subsection: ``` html <div> <h1>one</h1> <div> <h2>two</h2> </div> </div> ``` ``` html <div> <h1>one</h1> <div> <h1>two</h1> </div> </div> ``` Note that ``` html <h1>one</h1> <div> <h2>two</h2> </div> <h1>three</h1> ``` gets parsed as the structure one two three which may not always be desirable. Closes #3057.
Diffstat (limited to 'test')
-rw-r--r--test/command/3057.md54
1 files changed, 54 insertions, 0 deletions
diff --git a/test/command/3057.md b/test/command/3057.md
new file mode 100644
index 000000000..b1f3a8c2e
--- /dev/null
+++ b/test/command/3057.md
@@ -0,0 +1,54 @@
+```
+% pandoc -f markdown -t docbook
+<div>
+# one
+<div>
+## two
+</div>
+</div>
+^D
+<section>
+ <title>one</title>
+ <section>
+ <title>two</title>
+ <para>
+ </para>
+ </section>
+</section>
+```
+
+```
+% pandoc -f markdown -t docbook
+<div>
+# one
+<div>
+# two
+</div>
+</div>
+^D
+<section>
+ <title>one</title>
+ <section>
+ <title>two</title>
+ <para>
+ </para>
+ </section>
+</section>
+```
+
+```
+% pandoc -f markdown -t docbook
+# one
+<div>
+# two
+</div>
+^D
+<section xml:id="one">
+ <title>one</title>
+ <section>
+ <title>two</title>
+ <para>
+ </para>
+ </section>
+</section>
+```