Skip to content

Commit bf6ee73

Browse files
authored
fix: Fix an edge case in the table of contents in text output (#735)
* chore: Update tests * fix: Fix an edge case in the table of contents in text output
1 parent 4262e58 commit bf6ee73

26 files changed

+315
-229
lines changed

tests/input/draft-miek-test.xml

+3
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,9 @@ draft-gieben-writing-rfcs-pandoc-00.txt -> draft.txt
986986
<t>
987987
Test a very long title.
988988
</t>
989+
<section title="S/MIME encrypted and signed over a simple message, Injected Headers with hcp_minimal (+ Legacy Display)" toc="default">
990+
<t>Test long title edge case</t>
991+
</section>
989992
</section>
990993
<section title="Markup in heading" anchor="markup-in-heading" toc="default">
991994
<t>

tests/valid/docfile.py36.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
<meta charset="utf-8">
55
<meta content="Cherokee,Common,Greek,Latin" name="scripts">
66
<meta content="initial-scale=1.0" name="viewport">
7-
<title>Xml2rfc Vocabulary Version 3 Schema xml2rfc release 3.12.1</title>
7+
<title>Xml2rfc Vocabulary Version 3 Schema xml2rfc release 3.12.3</title>
88
<meta content="xml2rfc(1)" name="author">
99
<meta content="
1010
1111
This document provides information about the XML schema implemented in this release of xml2rfc, and the individual elements of that schema. The document is generated from the RNG schema file that is part of the xml2rfc distribution, so schema information in this document should always be in sync with the schema in actual use. The textual descriptions depend on manual updates in order to reflect the implementation.
1212
1313
" name="description">
14-
<meta content="xml2rfc 3.12.1" name="generator">
15-
<meta content="xml2rfc-docs-3.12.1" name="ietf.draft">
14+
<meta content="xml2rfc 3.12.3" name="generator">
15+
<meta content="xml2rfc-docs-3.12.3" name="ietf.draft">
1616
<link href="tests/out/docfile.xml" rel="alternate" type="application/rfc+xml">
1717
<link href="#copyright" rel="license">
1818
<link href="xml2rfc.css" rel="stylesheet">
@@ -45,7 +45,7 @@
4545
</dd>
4646
</dl>
4747
</div>
48-
<h1 id="title">Xml2rfc Vocabulary Version 3 Schema<br>xml2rfc release 3.12.1</h1>
48+
<h1 id="title">Xml2rfc Vocabulary Version 3 Schema<br>xml2rfc release 3.12.3</h1>
4949
<section id="section-abstract">
5050
<h2 id="abstract"><a href="#abstract" class="selfRef">Abstract</a></h2>
5151
<p id="section-abstract-1">
@@ -367,7 +367,7 @@ <h2 id="name-introduction">
367367
<p id="section-1-5">
368368
The latest version of this documentation is available in HTML form at <span><a href="https://xml2rfc.ietf.org/xml2rfc-doc">https://xml2rfc.ietf.org/xml2rfc-doc</a></span>.<a href="#section-1-5" class="pilcrow"></a></p>
369369
<p id="section-1-6">
370-
This documentation applies to xml2rfc version 3.12.1.<a href="#section-1-6" class="pilcrow"></a></p>
370+
This documentation applies to xml2rfc version 3.12.3.<a href="#section-1-6" class="pilcrow"></a></p>
371371
</section>
372372
<section id="section-2">
373373
<h2 id="name-schema-version-3-elements">
@@ -2882,7 +2882,7 @@ <h4 id="name-name-attribute-2">
28822882
<a href="#section-2.53.3" class="section-number selfRef">2.53.3. </a><a href="#name-name-attribute-2" class="section-name selfRef">"name" Attribute</a>
28832883
</h4>
28842884
<p id="section-2.53.3-1">
2885-
A filename suitable for the contents (such as for extraction to a local file). This attribute can be helpful for other kinds of tools (such as automated syntax checkers, which work by extracting the source code). Note that the "name" attribute does not need to be unique for &lt;artwork&gt; elements in a document. If multiple &lt;sourcecode&gt; elements have the same "name" attribute, a formatter might assume that the elements are all fragments of a single file, and such a formatter can collect those fragments for later processing.<a href="#section-2.53.3-1" class="pilcrow"></a></p>
2885+
A filename suitable for the contents (such as for extraction to a local file). This attribute can be helpful for other kinds of tools (such as automated syntax checkers, which work by extracting the source code). Note that the "name" attribute does not need to be unique for &lt;sourcecode&gt; elements in a document. If multiple &lt;sourcecode&gt; elements have the same "name" attribute, a formatter might assume that the elements are all fragments of a single file, and such a formatter can collect those fragments for later processing.<a href="#section-2.53.3-1" class="pilcrow"></a></p>
28862886
</section>
28872887
</div>
28882888
<div id="attrib-sourcecode-src">
@@ -6342,7 +6342,7 @@ <h2 id="name-xml2rfc-documentation-templ">
63426342
<p id="appendix-D-1">
63436343

63446344
The following variables are available for use in an xml2rfc
6345-
manpage Jinja2 template, as of xml2rfc version 3.12.1:<a href="#appendix-D-1" class="pilcrow"></a></p>
6345+
manpage Jinja2 template, as of xml2rfc version 3.12.3:<a href="#appendix-D-1" class="pilcrow"></a></p>
63466346
<span class="break"></span><dl class="dlNewline" id="appendix-D-2">
63476347
<dt id="appendix-D-2.1">{{ bare_latin_tags }}:</dt>
63486348
<dd style="margin-left: 1.5em" id="appendix-D-2.2"></dd>

tests/valid/docfile.py37.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
<meta charset="utf-8">
55
<meta content="Cherokee,Common,Greek,Latin" name="scripts">
66
<meta content="initial-scale=1.0" name="viewport">
7-
<title>Xml2rfc Vocabulary Version 3 Schema xml2rfc release 3.12.1</title>
7+
<title>Xml2rfc Vocabulary Version 3 Schema xml2rfc release 3.12.3</title>
88
<meta content="xml2rfc(1)" name="author">
99
<meta content="
1010
1111
This document provides information about the XML schema implemented in this release of xml2rfc, and the individual elements of that schema. The document is generated from the RNG schema file that is part of the xml2rfc distribution, so schema information in this document should always be in sync with the schema in actual use. The textual descriptions depend on manual updates in order to reflect the implementation.
1212
1313
" name="description">
14-
<meta content="xml2rfc 3.12.1" name="generator">
15-
<meta content="xml2rfc-docs-3.12.1" name="ietf.draft">
14+
<meta content="xml2rfc 3.12.3" name="generator">
15+
<meta content="xml2rfc-docs-3.12.3" name="ietf.draft">
1616
<link href="tests/out/docfile.xml" rel="alternate" type="application/rfc+xml">
1717
<link href="#copyright" rel="license">
1818
<link href="xml2rfc.css" rel="stylesheet">
@@ -45,7 +45,7 @@
4545
</dd>
4646
</dl>
4747
</div>
48-
<h1 id="title">Xml2rfc Vocabulary Version 3 Schema<br>xml2rfc release 3.12.1</h1>
48+
<h1 id="title">Xml2rfc Vocabulary Version 3 Schema<br>xml2rfc release 3.12.3</h1>
4949
<section id="section-abstract">
5050
<h2 id="abstract"><a href="#abstract" class="selfRef">Abstract</a></h2>
5151
<p id="section-abstract-1">
@@ -367,7 +367,7 @@ <h2 id="name-introduction">
367367
<p id="section-1-5">
368368
The latest version of this documentation is available in HTML form at <span><a href="https://xml2rfc.ietf.org/xml2rfc-doc">https://xml2rfc.ietf.org/xml2rfc-doc</a></span>.<a href="#section-1-5" class="pilcrow"></a></p>
369369
<p id="section-1-6">
370-
This documentation applies to xml2rfc version 3.12.1.<a href="#section-1-6" class="pilcrow"></a></p>
370+
This documentation applies to xml2rfc version 3.12.3.<a href="#section-1-6" class="pilcrow"></a></p>
371371
</section>
372372
<section id="section-2">
373373
<h2 id="name-schema-version-3-elements">
@@ -2882,7 +2882,7 @@ <h4 id="name-name-attribute-2">
28822882
<a href="#section-2.53.3" class="section-number selfRef">2.53.3. </a><a href="#name-name-attribute-2" class="section-name selfRef">"name" Attribute</a>
28832883
</h4>
28842884
<p id="section-2.53.3-1">
2885-
A filename suitable for the contents (such as for extraction to a local file). This attribute can be helpful for other kinds of tools (such as automated syntax checkers, which work by extracting the source code). Note that the "name" attribute does not need to be unique for &lt;artwork&gt; elements in a document. If multiple &lt;sourcecode&gt; elements have the same "name" attribute, a formatter might assume that the elements are all fragments of a single file, and such a formatter can collect those fragments for later processing.<a href="#section-2.53.3-1" class="pilcrow"></a></p>
2885+
A filename suitable for the contents (such as for extraction to a local file). This attribute can be helpful for other kinds of tools (such as automated syntax checkers, which work by extracting the source code). Note that the "name" attribute does not need to be unique for &lt;sourcecode&gt; elements in a document. If multiple &lt;sourcecode&gt; elements have the same "name" attribute, a formatter might assume that the elements are all fragments of a single file, and such a formatter can collect those fragments for later processing.<a href="#section-2.53.3-1" class="pilcrow"></a></p>
28862886
</section>
28872887
</div>
28882888
<div id="attrib-sourcecode-src">
@@ -6342,7 +6342,7 @@ <h2 id="name-xml2rfc-documentation-templ">
63426342
<p id="appendix-D-1">
63436343

63446344
The following variables are available for use in an xml2rfc
6345-
manpage Jinja2 template, as of xml2rfc version 3.12.1:<a href="#appendix-D-1" class="pilcrow"></a></p>
6345+
manpage Jinja2 template, as of xml2rfc version 3.12.3:<a href="#appendix-D-1" class="pilcrow"></a></p>
63466346
<span class="break"></span><dl class="dlNewline" id="appendix-D-2">
63476347
<dt id="appendix-D-2.1">{{ bare_latin_tags }}:</dt>
63486348
<dd style="margin-left: 1.5em" id="appendix-D-2.2"></dd>

tests/valid/docfile.py38.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
<meta charset="utf-8">
55
<meta content="Cherokee,Common,Greek,Latin" name="scripts">
66
<meta content="initial-scale=1.0" name="viewport">
7-
<title>Xml2rfc Vocabulary Version 3 Schema xml2rfc release 3.12.1</title>
7+
<title>Xml2rfc Vocabulary Version 3 Schema xml2rfc release 3.12.3</title>
88
<meta content="xml2rfc(1)" name="author">
99
<meta content="
1010
1111
This document provides information about the XML schema implemented in this release of xml2rfc, and the individual elements of that schema. The document is generated from the RNG schema file that is part of the xml2rfc distribution, so schema information in this document should always be in sync with the schema in actual use. The textual descriptions depend on manual updates in order to reflect the implementation.
1212
1313
" name="description">
14-
<meta content="xml2rfc 3.12.1" name="generator">
15-
<meta content="xml2rfc-docs-3.12.1" name="ietf.draft">
14+
<meta content="xml2rfc 3.12.3" name="generator">
15+
<meta content="xml2rfc-docs-3.12.3" name="ietf.draft">
1616
<link href="tests/out/docfile.xml" rel="alternate" type="application/rfc+xml">
1717
<link href="#copyright" rel="license">
1818
<link href="xml2rfc.css" rel="stylesheet">
@@ -45,7 +45,7 @@
4545
</dd>
4646
</dl>
4747
</div>
48-
<h1 id="title">Xml2rfc Vocabulary Version 3 Schema<br>xml2rfc release 3.12.1</h1>
48+
<h1 id="title">Xml2rfc Vocabulary Version 3 Schema<br>xml2rfc release 3.12.3</h1>
4949
<section id="section-abstract">
5050
<h2 id="abstract"><a href="#abstract" class="selfRef">Abstract</a></h2>
5151
<p id="section-abstract-1">
@@ -367,7 +367,7 @@ <h2 id="name-introduction">
367367
<p id="section-1-5">
368368
The latest version of this documentation is available in HTML form at <span><a href="https://xml2rfc.ietf.org/xml2rfc-doc">https://xml2rfc.ietf.org/xml2rfc-doc</a></span>.<a href="#section-1-5" class="pilcrow"></a></p>
369369
<p id="section-1-6">
370-
This documentation applies to xml2rfc version 3.12.1.<a href="#section-1-6" class="pilcrow"></a></p>
370+
This documentation applies to xml2rfc version 3.12.3.<a href="#section-1-6" class="pilcrow"></a></p>
371371
</section>
372372
<section id="section-2">
373373
<h2 id="name-schema-version-3-elements">
@@ -2882,7 +2882,7 @@ <h4 id="name-name-attribute-2">
28822882
<a href="#section-2.53.3" class="section-number selfRef">2.53.3. </a><a href="#name-name-attribute-2" class="section-name selfRef">"name" Attribute</a>
28832883
</h4>
28842884
<p id="section-2.53.3-1">
2885-
A filename suitable for the contents (such as for extraction to a local file). This attribute can be helpful for other kinds of tools (such as automated syntax checkers, which work by extracting the source code). Note that the "name" attribute does not need to be unique for &lt;artwork&gt; elements in a document. If multiple &lt;sourcecode&gt; elements have the same "name" attribute, a formatter might assume that the elements are all fragments of a single file, and such a formatter can collect those fragments for later processing.<a href="#section-2.53.3-1" class="pilcrow"></a></p>
2885+
A filename suitable for the contents (such as for extraction to a local file). This attribute can be helpful for other kinds of tools (such as automated syntax checkers, which work by extracting the source code). Note that the "name" attribute does not need to be unique for &lt;sourcecode&gt; elements in a document. If multiple &lt;sourcecode&gt; elements have the same "name" attribute, a formatter might assume that the elements are all fragments of a single file, and such a formatter can collect those fragments for later processing.<a href="#section-2.53.3-1" class="pilcrow"></a></p>
28862886
</section>
28872887
</div>
28882888
<div id="attrib-sourcecode-src">
@@ -6342,7 +6342,7 @@ <h2 id="name-xml2rfc-documentation-templ">
63426342
<p id="appendix-D-1">
63436343

63446344
The following variables are available for use in an xml2rfc
6345-
manpage Jinja2 template, as of xml2rfc version 3.12.1:<a href="#appendix-D-1" class="pilcrow"></a></p>
6345+
manpage Jinja2 template, as of xml2rfc version 3.12.3:<a href="#appendix-D-1" class="pilcrow"></a></p>
63466346
<span class="break"></span><dl class="dlNewline" id="appendix-D-2">
63476347
<dt id="appendix-D-2.1">{{ bare_latin_tags }}:</dt>
63486348
<dd style="margin-left: 1.5em" id="appendix-D-2.2"></dd>

0 commit comments

Comments
 (0)