ietf-tools / xml2rfc

Generate RFCs and IETF drafts from document source in XML according to the IETF xml2rfc v2 and v3 vocabularies
https://ietf-tools.github.io/xml2rfc/
BSD 3-Clause "New" or "Revised" License
65 stars 38 forks source link

fix: Render child elements in the xref element #1036

Closed kesara closed 11 months ago

kesara commented 11 months ago

This change fixes a bug where child elements were not rendered in the xref element with a section attribute.

This change only affects HTML & PDF outputs.

Fixes #1034

Example outputs

Example XML snippet:

<section anchor="introduction"><name>Introduction</name>

 <t>See Section <xref target="RFC8610" section="2" sectionFormat="bare">The <em>Style</em> of Data Structure Specification</xref> of <xref target="RFC8610">CDDL</xref>.</t>
 <t>See <xref target="RFC8610" section="2" sectionFormat="parens">The <em>Style</em> of Data Structure Specification</xref> of <xref target="RFC8610">CDDL</xref>.</t>
 <t>See <xref target="RFC8610" section="2" sectionFormat="comma">The <em>Style</em> of Data Structure Specification</xref> of <xref target="RFC8610">CDDL</xref>.</t>
 <t>See <xref target="RFC8610" section="2" sectionFormat="of">The <em>Style</em> of Data Structure Specification</xref> of <xref target="RFC8610">CDDL</xref>.</t>
 <t>See <xref target="RFC8610" section="2">The <em>Style</em> of Data Structure Specification</xref> of <xref target="RFC8610">CDDL</xref>.</t>

 <t>See <xref target="introduction">The <em>Style</em> of Data Structure Specification</xref></t>

 <t>See <xref target="RFC8610" section="2"/>.</t>
 <t>See <xref target="RFC8610" section="2" sectionFormat="parens"/>.</t>
 <t>See <xref target="RFC8610" section="2" sectionFormat="comma"/>.</t>
 <t>See <xref target="RFC8610" section="2" sectionFormat="of"/>.</t>
 <t>See <xref target="RFC8610" section="2" sectionFormat="bare"/>.</t>

</section>

Sample HTML outputs

Before proposed changes

Screenshot 2023-09-27 at 9 40 11 PM

After the proposed changes

Screenshot 2023-09-27 at 9 42 44 PM

Sample PDF outputs

Before proposed changes

Screenshot 2023-09-27 at 9 40 36 PM

After the proposed changes

Screenshot 2023-09-27 at 9 43 53 PM