test(extract): a section below markdown's sixth level keeps its own level in the plan

K3-21 D, red. The NISO-STS reader clips `depth` to 6 once and writes that
one value into BOTH the ATX heading, where markdown has six levels, and the
`OutlineMark` the declared route builds its plan from, where nothing clips.
On one standard 9 of 2 761 titled sections sit at depth 7; the plan read them
at 6, and `--shell-parent` gave its two depth-7 shells the ancestor one level
too high.

`sts-deep.xml` (invented setting) reproduces it: the two depth-7 shells point
at the depth-5 section on e717b1c's code and must point at the depth-6 one.
Held: the mark carries depth 7; the heading stays `######` and the extracted
headings do not move one character; the shells point at their depth-6
ancestor.

2 of 3 red on 5970369; the green one is the text guard.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-09-11 14:02:49 +02:00
commit 9822e5500c
2 changed files with 109 additions and 0 deletions

26
tests/fixtures/sts-deep.xml vendored Normal file
View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<standard>
<front>
<std-meta>
<title-wrap><main>Fikstur for dyp nesting</main></title-wrap>
</std-meta>
</front>
<body>
<sec sec-type="procedure" id="d1"><label>1</label><title>Nivaa en</title>
<sec sec-type="procedure" id="d11"><label>1.1</label><title>Nivaa to</title>
<sec sec-type="procedure" id="d111"><label>1.11</label><title>Nivaa tre</title>
<sec sec-type="procedure" id="d1111"><label>1.111</label><title>Nivaa fire</title>
<sec sec-type="procedure" id="d11111"><label>1.1111</label><title>Nivaa fem</title>
<sec sec-type="spec"><label>a)</label><p>Omfatter arbeid paa femte nivaa.</p></sec>
<sec sec-type="procedure" id="d111111"><label>1.11111</label><title>Nivaa seks</title>
<sec sec-type="spec"><label>a)</label><p>Omfatter arbeid paa sjette nivaa.</p></sec>
<sec sec-type="procedure" id="d1111111"><label>1.111111</label><title>Nivaa sju foerste</title></sec>
<sec sec-type="procedure" id="d1111112"><label>1.111112</label><title>Nivaa sju andre</title></sec>
</sec>
</sec>
</sec>
</sec>
</sec>
</sec>
</body>
</standard>