Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions tests/input/sourcecode.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,35 @@ print("49")
print("50")
</sourcecode>
</section>
<section>
<name>RFC 8792 wrapping</name>
<t>Source code using the single backslash strategy:</t>
<sourcecode name="single-wrap.txt"><![CDATA[========== NOTE: '\' line wrapping per RFC 8792 ===========

first folded line \
continues here
second folded line \
also continues
]]></sourcecode>
<t>Text artwork using the double backslash strategy:</t>
<artwork><![CDATA[[NOTE: '\\' line wrapping per RFC 8792]

first folded line \
\continues here
second folded line \
\also continues
]]></artwork>
<t>Source code with renderer-added markers:</t>
<sourcecode name="marked-wrap.txt" markers="true"><![CDATA[NOTE: '\' line wrapping per RFC 8792

marked folded line \
continues here
]]></sourcecode>
<t>A quoted header without folded content is not copyable:</t>
<sourcecode><![CDATA[NOTE: '\' line wrapping per RFC 8792
This block mentions the header but does not use RFC 8792 folding.
]]></sourcecode>
</section>
</middle>
<back>
<references>
Expand Down
84 changes: 70 additions & 14 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 March 30, 2026
Internet-Draft May 14, 2026
Intended status: Experimental
Expires: October 1, 2026
Expires: November 15, 2026


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 October 1, 2026.
This Internet-Draft will expire on November 15, 2026.

Copyright Notice

Expand All @@ -42,20 +42,20 @@ Copyright Notice
Table of Contents

1. Less than 50 lines . . . . . . . . . . . . . . . . . . . . . 1
2. References . . . . . . . . . . . . . . . . . . . . . . . . . 4
2. RFC 8792 wrapping . . . . . . . . . . . . . . . . . . . . . . 4
3. References . . . . . . . . . . . . . . . . . . . . . . . . . 4
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 4
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 5

1. Less than 50 lines






Person Expires October 1, 2026 [Page 1]
Person Expires November 15, 2026 [Page 1]

Internet-Draft xml2rfc sourcecode tests March 2026
Internet-Draft xml2rfc sourcecode tests May 2026


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



Person Expires October 1, 2026 [Page 2]
Person Expires November 15, 2026 [Page 2]

Internet-Draft xml2rfc sourcecode tests March 2026
Internet-Draft xml2rfc sourcecode tests May 2026


print("49")
Expand Down Expand Up @@ -165,17 +165,51 @@ Internet-Draft xml2rfc sourcecode tests March 2026



Person Expires October 1, 2026 [Page 3]
Person Expires November 15, 2026 [Page 3]

Internet-Draft xml2rfc sourcecode tests March 2026
Internet-Draft xml2rfc sourcecode tests May 2026


print("47")
print("48")
print("49")
print("50")

2. References
2. RFC 8792 wrapping

Source code using the single backslash strategy:

========== NOTE: '\' line wrapping per RFC 8792 ===========

first folded line \
continues here
second folded line \
also continues

Text artwork using the double backslash strategy:

[NOTE: '\\' line wrapping per RFC 8792]

first folded line \
\continues here
second folded line \
\also continues

Source code with renderer-added markers:

<CODE BEGINS> file "marked-wrap.txt"
NOTE: '\' line wrapping per RFC 8792

marked folded line \
continues here
<CODE ENDS>

A quoted header without folded content is not copyable:

NOTE: '\' line wrapping per RFC 8792
This block mentions the header but does not use RFC 8792 folding.

3. References

[ref0] Author, R. Q., "Reference". This is a reference not in a
reference group.
Expand All @@ -184,6 +218,14 @@ Index

A




Person Expires November 15, 2026 [Page 4]

Internet-Draft xml2rfc sourcecode tests May 2026


A

annotation Reference [ref0]
Expand Down Expand Up @@ -221,4 +263,18 @@ Author's Address



Person Expires October 1, 2026 [Page 4]














Person Expires November 15, 2026 [Page 5]
48 changes: 40 additions & 8 deletions tests/valid/sourcecode.prepped.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?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="2026-03-30T22:40:21" indexInclude="true" scripts="Common,Latin" symRefs="true" tocDepth="3" tocInclude="true">
<!-- xml2rfc v2v3 conversion 3.32.0 -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" sortRefs="true" category="exp" submissionType="independent" ipr="trust200902" docName="sourcecode-00" prepTime="2026-05-14T10:47:17" indexInclude="true" scripts="Common,Latin" symRefs="true" tocDepth="3" tocInclude="true">
<!-- xml2rfc v2v3 conversion 3.33.0 -->



Expand All @@ -20,7 +20,7 @@
</postal>
</address>
</author>
<date day="30" month="03" year="2026"/>
<date day="14" month="05" year="2026"/>
<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 1 October 2026.
This Internet-Draft will expire on 15 November 2026.
</t>
</section>
<section anchor="copyright" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.2">
Expand All @@ -68,13 +68,16 @@
<t indent="0" keepWithNext="true" pn="section-toc.1-1.1.1"><xref derivedContent="1" format="counter" sectionFormat="of" target="section-1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-less-than-50-lines">Less than 50 lines</xref></t>
</li>
<li pn="section-toc.1-1.2">
<t indent="0" keepWithNext="true" pn="section-toc.1-1.2.1"><xref derivedContent="2" format="counter" sectionFormat="of" target="section-2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-references">References</xref></t>
<t indent="0" keepWithNext="true" pn="section-toc.1-1.2.1"><xref derivedContent="2" format="counter" sectionFormat="of" target="section-2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-rfc-8792-wrapping">RFC 8792 wrapping</xref></t>
</li>
<li pn="section-toc.1-1.3">
<t indent="0" keepWithNext="true" pn="section-toc.1-1.3.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.a"/><xref derivedContent="" format="title" sectionFormat="of" target="name-index">Index</xref></t>
<t indent="0" keepWithNext="true" pn="section-toc.1-1.3.1"><xref derivedContent="3" format="counter" sectionFormat="of" target="section-3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-references">References</xref></t>
</li>
<li pn="section-toc.1-1.4">
<t indent="0" pn="section-toc.1-1.4.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.b"/><xref derivedContent="" format="title" sectionFormat="of" target="name-authors-address">Author's Address</xref></t>
<t indent="0" pn="section-toc.1-1.4.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.a"/><xref derivedContent="" format="title" sectionFormat="of" target="name-index">Index</xref></t>
</li>
<li pn="section-toc.1-1.5">
<t indent="0" pn="section-toc.1-1.5.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.b"/><xref derivedContent="" format="title" sectionFormat="of" target="name-authors-address">Author's Address</xref></t>
</li>
</ul>
</section>
Expand Down Expand Up @@ -183,11 +186,40 @@ print("47")
print("48")
print("49")
print("50")
</sourcecode>
</section>
<section numbered="true" removeInRFC="false" toc="include" pn="section-2">
<name slugifiedName="name-rfc-8792-wrapping">RFC 8792 wrapping</name>
<t indent="0" pn="section-2-1">Source code using the single backslash strategy:</t>
<sourcecode name="single-wrap.txt" markers="false" pn="section-2-2">========== NOTE: '\' line wrapping per RFC 8792 ===========

first folded line \
continues here
second folded line \
also continues
</sourcecode>
<t indent="0" pn="section-2-3">Text artwork using the double backslash strategy:</t>
<artwork align="left" pn="section-2-4"><![CDATA[[NOTE: '\\' line wrapping per RFC 8792]

first folded line \
\continues here
second folded line \
\also continues
]]></artwork>
<t indent="0" pn="section-2-5">Source code with renderer-added markers:</t>
<sourcecode name="marked-wrap.txt" markers="true" pn="section-2-6">NOTE: '\' line wrapping per RFC 8792

marked folded line \
continues here
</sourcecode>
<t indent="0" pn="section-2-7">A quoted header without folded content is not copyable:</t>
<sourcecode markers="false" pn="section-2-8">NOTE: '\' line wrapping per RFC 8792
This block mentions the header but does not use RFC 8792 folding.
</sourcecode>
</section>
</middle>
<back>
<references pn="section-2">
<references pn="section-3">
<name slugifiedName="name-references">References</name>
<reference anchor="ref0" quoteTitle="true" derivedAnchor="ref0">
<front>
Expand Down
45 changes: 40 additions & 5 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 March 30, 2026
Internet-Draft May 14, 2026
Intended status: Experimental
Expires: October 1, 2026
Expires: November 15, 2026


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 October 1, 2026.
This Internet-Draft will expire on November 15, 2026.

Copyright Notice

Expand All @@ -42,7 +42,8 @@ Copyright Notice
Table of Contents

1. Less than 50 lines
2. References
2. RFC 8792 wrapping
3. References
Index
Author's Address

Expand Down Expand Up @@ -149,7 +150,41 @@ Table of Contents
print("49")
print("50")

2. References
2. RFC 8792 wrapping

Source code using the single backslash strategy:

========== NOTE: '\' line wrapping per RFC 8792 ===========

first folded line \
continues here
second folded line \
also continues

Text artwork using the double backslash strategy:

[NOTE: '\\' line wrapping per RFC 8792]

first folded line \
\continues here
second folded line \
\also continues

Source code with renderer-added markers:

<CODE BEGINS> file "marked-wrap.txt"
NOTE: '\' line wrapping per RFC 8792

marked folded line \
continues here
<CODE ENDS>

A quoted header without folded content is not copyable:

NOTE: '\' line wrapping per RFC 8792
This block mentions the header but does not use RFC 8792 folding.

3. References

[ref0] Author, R. Q., "Reference". This is a reference not in a
reference group.
Expand Down
Loading
Loading