summaryrefslogtreecommitdiff
path: root/test/command
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2022-10-18 12:42:12 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2022-10-18 12:42:12 -0700
commiteff82cfe4de44a111250ce9ce3ecee2fd4d99924 (patch)
tree086bec92e1f2acdd6c61296418787adba75cf05b /test/command
parent20492d523c8324e36781cfbbc8092c796f94b151 (diff)
Markdown reader: avoid duplicate ids with auto_identifiers.
We previously avoided generating a duplicate with another automatically generated identifier; now we also avoid duplicates with explicit identifiers that occur before the header for which an identifier is being generated. (Collisions are still possible for identifiers that occur after the header.) T.P.Shared: `makeSections` is also modified so it doesn't give bad results when the enclosing Div has a different identifier from the header, as may now happen.
Diffstat (limited to 'test/command')
-rw-r--r--test/command/6384.md8
-rw-r--r--test/command/section-divs.md6
2 files changed, 7 insertions, 7 deletions
diff --git a/test/command/6384.md b/test/command/6384.md
index 1be1c3e45..5873f433a 100644
--- a/test/command/6384.md
+++ b/test/command/6384.md
@@ -1,16 +1,16 @@
```
% pandoc --wrap=preserve --file-scope command/file1.txt command/file2.txt
^D
-<div id="command__file1.txt">
+<section id="command__file1.txt">
<h1 id="command__file1.txt__zed">Zed</h1>
<p><a href="bar">foo</a>
and <a href="#command__file1.txt__zed">Zed</a>
and <a href="#command__file2.txt__zed">other Zed</a>
and <a href="#command__file2.txt">other file</a>
and <a href="c.md#zed">foreign Zed</a></p>
-</div>
-<div id="command__file2.txt">
+</section>
+<section id="command__file2.txt">
<h2 id="command__file2.txt__zed">Zed</h2>
<p><a href="baz">foo</a></p>
-</div>
+</section>
```
diff --git a/test/command/section-divs.md b/test/command/section-divs.md
index 5ee28bba8..d34ed3bd1 100644
--- a/test/command/section-divs.md
+++ b/test/command/section-divs.md
@@ -14,12 +14,12 @@ Ok
:::
^D
<section id="hi" class="level1">
-<h1>Hi</h1>
+<h1 id="hi-1">Hi</h1>
<section id="there" class="level2">
-<h2>there</h2>
+<h2 id="there-1">there</h2>
</section>
</section>
<section id="ok" class="level1">
-<h1>Ok</h1>
+<h1 id="ok-1">Ok</h1>
</section>
```