Skip to content

Commit

Permalink
fix: Render child elements in the xref element (#1036)
Browse files Browse the repository at this point in the history
This change fixes a bug where child elements were not rendered in `xref`
element with a `section` attribute.

This change only affects HTML & PDF outputs.

Fixes #1034
  • Loading branch information
kesara authored Sep 27, 2023
1 parent b6bdd70 commit 9ea862c
Show file tree
Hide file tree
Showing 21 changed files with 81 additions and 62 deletions.
3 changes: 2 additions & 1 deletion tests/input/elements.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@
<li>
Text and format="default": Sections
<xref target="RFC7997" format="default" sectionFormat="bare" section="3.2">Person Names</xref> and
<xref target="RFC7997" format="default" sectionFormat="bare" section="3.3">Company Names</xref> of
<xref target="RFC7997" format="default" sectionFormat="bare" section="3.3">Company Names</xref> and
<xref target="RFC7997" format="default" sectionFormat="bare" section="3.3">a <em>lot</em> <strong>more</strong> information</xref> of
<xref target="RFC7997" format="default"/>.

</li>
Expand Down
4 changes: 2 additions & 2 deletions tests/valid/docfile.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<thead><tr>
<td class="left"></td>
<td class="center">Xml2rfc Vocabulary V3 Schema</td>
<td class="right">August 2023</td>
<td class="right">September 2023</td>
</tr></thead>
<tfoot><tr>
<td class="left">xml2rfc(1)</td>
Expand All @@ -39,7 +39,7 @@
<dd class="workgroup">xml2rfc(1)</dd>
<dt class="label-published">Published:</dt>
<dd class="published">
<time datetime="2023-08-21" class="published">21 August 2023</time>
<time datetime="2023-09-27" class="published">27 September 2023</time>
</dd>
<dt class="label-authors">Author:</dt>
<dd class="authors">
Expand Down
2 changes: 1 addition & 1 deletion tests/valid/draft-miek-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
intervaltree 3.1.0
Jinja2 3.1.2
lxml 4.9.3
platformdirs 3.9.1
platformdirs 3.10.0
pycountry 22.3.5
PyYAML 6.0.1
requests 2.31.0
Expand Down
2 changes: 1 addition & 1 deletion tests/valid/draft-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
intervaltree 3.1.0
Jinja2 3.1.2
lxml 4.9.3
platformdirs 3.9.1
platformdirs 3.10.0
pycountry 22.3.5
PyYAML 6.0.1
requests 2.31.0
Expand Down
2 changes: 1 addition & 1 deletion tests/valid/elements.bom.text
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018
sectionFormat="bare":

* Text and format="default": Sections 3.2 (Person Names) and 3.3
(Company Names) of [RFC7997].
(Company Names) and 3.3 (a _lot_ *more* information) of [RFC7997].



Expand Down
2 changes: 1 addition & 1 deletion tests/valid/elements.pages.text
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018
sectionFormat="bare":

* Text and format="default": Sections 3.2 (Person Names) and 3.3
(Company Names) of [RFC7997].
(Company Names) and 3.3 (a _lot_ *more* information) of [RFC7997].



Expand Down
5 changes: 3 additions & 2 deletions tests/valid/elements.prepped.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" submissionType="independent" ipr="trust200902" docName="elements-00" category="info" obsoletes="1234,5678,9012,3456,7890" sortRefs="true" indexInclude="false" prepTime="2023-08-02T01:35:51" scripts="Cherokee,Common,Greek,Han,Hebrew,Latin" symRefs="true" tocDepth="3" tocInclude="true">
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" submissionType="independent" ipr="trust200902" docName="elements-00" category="info" obsoletes="1234,5678,9012,3456,7890" sortRefs="true" indexInclude="false" prepTime="2023-09-27T20:11:31" scripts="Cherokee,Common,Greek,Han,Hebrew,Latin" symRefs="true" tocDepth="3" tocInclude="true">



Expand Down Expand Up @@ -333,7 +333,8 @@
<li pn="section-2-9.1">
Text and format="default": Sections
<xref target="RFC7997" format="default" sectionFormat="bare" section="3.2" derivedLink="https://rfc-editor.org/rfc/rfc7997#section-3.2" derivedContent="RFC7997">Person Names</xref> and
<xref target="RFC7997" format="default" sectionFormat="bare" section="3.3" derivedLink="https://rfc-editor.org/rfc/rfc7997#section-3.3" derivedContent="RFC7997">Company Names</xref> of
<xref target="RFC7997" format="default" sectionFormat="bare" section="3.3" derivedLink="https://rfc-editor.org/rfc/rfc7997#section-3.3" derivedContent="RFC7997">Company Names</xref> and
<xref target="RFC7997" format="default" sectionFormat="bare" section="3.3" derivedLink="https://rfc-editor.org/rfc/rfc7997#section-3.3" derivedContent="RFC7997">a <em>lot</em> <strong>more</strong> information</xref> of
<xref target="RFC7997" format="default" sectionFormat="of" derivedContent="RFC7997"/>.

</li>
Expand Down
2 changes: 1 addition & 1 deletion tests/valid/elements.text
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Table of Contents
sectionFormat="bare":

* Text and format="default": Sections 3.2 (Person Names) and 3.3
(Company Names) of [RFC7997].
(Company Names) and 3.3 (a _lot_ *more* information) of [RFC7997].

* Text and format="title": Not meaningful

Expand Down
5 changes: 3 additions & 2 deletions tests/valid/elements.v3.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<meta content="
This is the abstract.
" name="description">
<meta content="xml2rfc 3.17.5" name="generator">
<meta content="xml2rfc 3.18.0" name="generator">
<meta content="elements-00" name="ietf.draft">
<link href="tests/input/elements.xml" rel="alternate" type="application/rfc+xml">
<link href="#copyright" rel="license">
Expand Down Expand Up @@ -330,7 +330,8 @@ <h2 id="name-citations">
<li class="normal" id="section-2-9.1">
Text and format="default": Sections
<span><a href="https://rfc-editor.org/rfc/rfc7997#section-3.2" class="relref">3.2</a> (<a href="https://rfc-editor.org/rfc/rfc7997#section-3.2" class="relref">Person Names</a>)</span> and
<span><a href="https://rfc-editor.org/rfc/rfc7997#section-3.3" class="relref">3.3</a> (<a href="https://rfc-editor.org/rfc/rfc7997#section-3.3" class="relref">Company Names</a>)</span> of
<span><a href="https://rfc-editor.org/rfc/rfc7997#section-3.3" class="relref">3.3</a> (<a href="https://rfc-editor.org/rfc/rfc7997#section-3.3" class="relref">Company Names</a>)</span> and
<span><a href="https://rfc-editor.org/rfc/rfc7997#section-3.3" class="relref">3.3</a> (<a href="https://rfc-editor.org/rfc/rfc7997#section-3.3" class="relref">a <em>lot</em> <strong>more</strong> information</a>)</span> of
<span>[<a href="#RFC7997" class="cite xref">RFC7997</a>]</span>.<a href="#section-2-9.1" class="pilcrow"></a>
</li>
<li class="normal" id="section-2-9.2">
Expand Down
2 changes: 1 addition & 1 deletion tests/valid/elements.wip.text
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018
sectionFormat="bare":

* Text and format="default": Sections 3.2 (Person Names) and 3.3
(Company Names) of [RFC7997].
(Company Names) and 3.3 (a _lot_ *more* information) of [RFC7997].



Expand Down
16 changes: 8 additions & 8 deletions tests/valid/indexes.pages.text
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@


Network Working Group H. Person, Ed.
Internet-Draft August 30, 2023
Internet-Draft September 27, 2023
Intended status: Experimental
Expires: March 2, 2024
Expires: March 30, 2024


xml2rfc index tests
Expand All @@ -26,7 +26,7 @@ Status of This Memo
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."

This Internet-Draft will expire on March 2, 2024.
This Internet-Draft will expire on March 30, 2024.

Copyright Notice

Expand All @@ -53,9 +53,9 @@ Table of Contents



Person Expires March 2, 2024 [Page 1]
Person Expires March 30, 2024 [Page 1]

Internet-Draft xml2rfc index tests August 2023
Internet-Draft xml2rfc index tests September 2023


This is another section!
Expand Down Expand Up @@ -109,9 +109,9 @@ Index



Person Expires March 2, 2024 [Page 2]
Person Expires March 30, 2024 [Page 2]

Internet-Draft xml2rfc index tests August 2023
Internet-Draft xml2rfc index tests September 2023


E
Expand Down Expand Up @@ -165,4 +165,4 @@ Author's Address



Person Expires March 2, 2024 [Page 3]
Person Expires March 30, 2024 [Page 3]
6 changes: 3 additions & 3 deletions tests/valid/indexes.prepped.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" sortRefs="true" category="exp" submissionType="independent" ipr="trust200902" docName="indexes-00" indexInclude="true" prepTime="2023-08-30T08:01:10" scripts="Common,Latin" symRefs="true" tocDepth="3" tocInclude="true">
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" sortRefs="true" category="exp" submissionType="independent" ipr="trust200902" docName="indexes-00" indexInclude="true" prepTime="2023-09-27T02:01:34" scripts="Common,Latin" symRefs="true" tocDepth="3" tocInclude="true">
<!-- xml2rfc v2v3 conversion 3.18.0 -->


Expand All @@ -20,7 +20,7 @@
</postal>
</address>
</author>
<date day="30" month="08" year="2023"/>
<date day="27" month="09" year="2023"/>
<boilerplate>
<section anchor="status-of-memo" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.1">
<name slugifiedName="name-status-of-this-memo">Status of This Memo</name>
Expand All @@ -41,7 +41,7 @@
material or to cite them other than as "work in progress."
</t>
<t indent="0" pn="section-boilerplate.1-4">
This Internet-Draft will expire on 2 March 2024.
This Internet-Draft will expire on 30 March 2024.
</t>
</section>
<section anchor="copyright" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.2">
Expand Down
6 changes: 3 additions & 3 deletions tests/valid/indexes.text
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@


Network Working Group H. Person, Ed.
Internet-Draft August 30, 2023
Internet-Draft September 27, 2023
Intended status: Experimental
Expires: March 2, 2024
Expires: March 30, 2024


xml2rfc index tests
Expand All @@ -26,7 +26,7 @@ Status of This Memo
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."

This Internet-Draft will expire on March 2, 2024.
This Internet-Draft will expire on March 30, 2024.

Copyright Notice

Expand Down
10 changes: 5 additions & 5 deletions tests/valid/indexes.v3.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
<thead><tr>
<td class="left">Internet-Draft</td>
<td class="center">xml2rfc index tests</td>
<td class="right">August 2023</td>
<td class="right">September 2023</td>
</tr></thead>
<tfoot><tr>
<td class="left">Person</td>
<td class="center">Expires March 2, 2024</td>
<td class="center">Expires March 30, 2024</td>
<td class="right">[Page]</td>
</tr></tfoot>
</table>
Expand All @@ -36,12 +36,12 @@
<dd class="internet-draft">indexes-00</dd>
<dt class="label-published">Published:</dt>
<dd class="published">
<time datetime="2023-08-30" class="published">August 30, 2023</time>
<time datetime="2023-09-27" class="published">September 27, 2023</time>
</dd>
<dt class="label-intended-status">Intended Status:</dt>
<dd class="intended-status">Experimental</dd>
<dt class="label-expires">Expires:</dt>
<dd class="expires"><time datetime="2024-03-02">March 2, 2024</time></dd>
<dd class="expires"><time datetime="2024-03-30">March 30, 2024</time></dd>
<dt class="label-authors">Author:</dt>
<dd class="authors">
<div class="author">
Expand Down Expand Up @@ -71,7 +71,7 @@ <h2 id="name-status-of-this-memo">
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."<a href="#section-boilerplate.1-3" class="pilcrow"></a></p>
<p id="section-boilerplate.1-4">
This Internet-Draft will expire on March 2, 2024.<a href="#section-boilerplate.1-4" class="pilcrow"></a></p>
This Internet-Draft will expire on March 30, 2024.<a href="#section-boilerplate.1-4" class="pilcrow"></a></p>
</section>
</div>
<div id="copyright">
Expand Down
2 changes: 1 addition & 1 deletion tests/valid/manpage.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
xml2rfc(1) xml2rfc(1)
30 August 2023
27 September 2023


Xml2rfc Vocabulary Version 3 Schema
Expand Down
2 changes: 1 addition & 1 deletion tests/valid/rfc7911.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
intervaltree 3.1.0
Jinja2 3.1.2
lxml 4.9.3
platformdirs 3.9.1
platformdirs 3.10.0
pycountry 22.3.5
PyYAML 6.0.1
requests 2.31.0
Expand Down
20 changes: 10 additions & 10 deletions tests/valid/sourcecode.pages.text
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@


Network Working Group H. Person, Ed.
Internet-Draft August 30, 2023
Internet-Draft September 27, 2023
Intended status: Experimental
Expires: March 2, 2024
Expires: March 30, 2024


xml2rfc sourcecode tests
Expand All @@ -26,7 +26,7 @@ Status of This Memo
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."

This Internet-Draft will expire on March 2, 2024.
This Internet-Draft will expire on March 30, 2024.

Copyright Notice

Expand All @@ -53,9 +53,9 @@ Table of Contents



Person Expires March 2, 2024 [Page 1]
Person Expires March 30, 2024 [Page 1]

Internet-Draft xml2rfc sourcecode tests August 2023
Internet-Draft xml2rfc sourcecode tests September 2023


print("01")
Expand Down Expand Up @@ -109,9 +109,9 @@ Internet-Draft xml2rfc sourcecode tests August 2023



Person Expires March 2, 2024 [Page 2]
Person Expires March 30, 2024 [Page 2]

Internet-Draft xml2rfc sourcecode tests August 2023
Internet-Draft xml2rfc sourcecode tests September 2023


print("49")
Expand Down Expand Up @@ -165,9 +165,9 @@ Internet-Draft xml2rfc sourcecode tests August 2023



Person Expires March 2, 2024 [Page 3]
Person Expires March 30, 2024 [Page 3]

Internet-Draft xml2rfc sourcecode tests August 2023
Internet-Draft xml2rfc sourcecode tests September 2023


print("47")
Expand Down Expand Up @@ -221,4 +221,4 @@ Author's Address



Person Expires March 2, 2024 [Page 4]
Person Expires March 30, 2024 [Page 4]
6 changes: 3 additions & 3 deletions tests/valid/sourcecode.prepped.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" sortRefs="true" category="exp" submissionType="independent" ipr="trust200902" docName="sourcecode-00" prepTime="2023-08-30T08:01:18" indexInclude="true" scripts="Common,Latin" symRefs="true" tocDepth="3" tocInclude="true">
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" sortRefs="true" category="exp" submissionType="independent" ipr="trust200902" docName="sourcecode-00" prepTime="2023-09-27T02:01:42" indexInclude="true" scripts="Common,Latin" symRefs="true" tocDepth="3" tocInclude="true">
<!-- xml2rfc v2v3 conversion 3.18.0 -->


Expand All @@ -20,7 +20,7 @@
</postal>
</address>
</author>
<date day="30" month="08" year="2023"/>
<date day="27" month="09" year="2023"/>
<boilerplate>
<section anchor="status-of-memo" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.1">
<name slugifiedName="name-status-of-this-memo">Status of This Memo</name>
Expand All @@ -41,7 +41,7 @@
material or to cite them other than as "work in progress."
</t>
<t indent="0" pn="section-boilerplate.1-4">
This Internet-Draft will expire on 2 March 2024.
This Internet-Draft will expire on 30 March 2024.
</t>
</section>
<section anchor="copyright" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.2">
Expand Down
6 changes: 3 additions & 3 deletions tests/valid/sourcecode.text
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@


Network Working Group H. Person, Ed.
Internet-Draft August 30, 2023
Internet-Draft September 27, 2023
Intended status: Experimental
Expires: March 2, 2024
Expires: March 30, 2024


xml2rfc sourcecode tests
Expand All @@ -26,7 +26,7 @@ Status of This Memo
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."

This Internet-Draft will expire on March 2, 2024.
This Internet-Draft will expire on March 30, 2024.

Copyright Notice

Expand Down
Loading

0 comments on commit 9ea862c

Please sign in to comment.