From c8d3a94dcdfbc3f2d7cf508e7688931cdfac2da9 Mon Sep 17 00:00:00 2001 From: Kesara Rathnayake Date: Tue, 9 Jul 2024 20:17:10 +1200 Subject: [PATCH 1/9] fix: Render ol items correctly Fixes #1135 --- xml2rfc/writers/text.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xml2rfc/writers/text.py b/xml2rfc/writers/text.py index 01f90f16..82e9a9d7 100644 --- a/xml2rfc/writers/text.py +++ b/xml2rfc/writers/text.py @@ -2150,7 +2150,9 @@ def render_li(self, e, width, **kwargs): tt, __ = self.text_or_block_renderer(e, width, **kwargs) if isinstance(tt, list): lines = stripl(tt) - if lines and lines[0].elem.tag not in ['artwork', 'figure', 'sourcecode', 'li', ]: + if (lines and + lines[0].elem.tag not in ['artwork', 'figure', 'sourcecode'] and + not (p.tag == 'ul' and lines[0].elem.tag == 'li')): lines[0].text = text + lines[0].text.lstrip(stripspace) else: text += tt.lstrip(stripspace) From ccf2c89b3d5122e552427fbfbdccb0216bbe96dd Mon Sep 17 00:00:00 2001 From: Kesara Rathnayake Date: Tue, 9 Jul 2024 20:30:24 +1200 Subject: [PATCH 2/9] chore: Run yestests pre-changes --- tests/valid/docfile.html | 16 ++++++++-------- tests/valid/draft-miek-test.html | 17 ++++++++--------- tests/valid/draft-template.html | 17 ++++++++--------- tests/valid/indexes.pages.text | 16 ++++++++-------- tests/valid/indexes.prepped.xml | 8 ++++---- tests/valid/indexes.text | 6 +++--- tests/valid/indexes.v3.html | 12 ++++++------ tests/valid/manpage.txt | 10 +++++----- tests/valid/rfc7911.html | 17 ++++++++--------- tests/valid/sourcecode.pages.text | 20 ++++++++++---------- tests/valid/sourcecode.prepped.xml | 8 ++++---- tests/valid/sourcecode.text | 6 +++--- tests/valid/sourcecode.v3.html | 12 ++++++------ 13 files changed, 81 insertions(+), 84 deletions(-) diff --git a/tests/valid/docfile.html b/tests/valid/docfile.html index 78c113cc..c8c2edb2 100644 --- a/tests/valid/docfile.html +++ b/tests/valid/docfile.html @@ -4,15 +4,15 @@ -Xml2rfc Vocabulary Version 3 Schema xml2rfc release 3.21.0 +Xml2rfc Vocabulary Version 3 Schema xml2rfc release 3.22.0 - - + + @@ -24,7 +24,7 @@ Xml2rfc Vocabulary V3 Schema -April 2024 +July 2024 xml2rfc(1) @@ -39,7 +39,7 @@
xml2rfc(1)
Published:
- +
Author:
@@ -49,7 +49,7 @@
-

Xml2rfc Vocabulary Version 3 Schema
xml2rfc release 3.21.0

+

Xml2rfc Vocabulary Version 3 Schema
xml2rfc release 3.22.0

Abstract

@@ -371,7 +371,7 @@

The latest version of this documentation is available in HTML form at https://ietf-tools.github.io/xml2rfc/.

- This documentation applies to xml2rfc version 3.21.0.

+ This documentation applies to xml2rfc version 3.22.0.

@@ -6367,7 +6367,7 @@

The following variables are available for use in an xml2rfc - manpage Jinja2 template, as of xml2rfc version 3.21.0:

+ manpage Jinja2 template, as of xml2rfc version 3.22.0:

{{ bare_latin_tags }}:
diff --git a/tests/valid/draft-miek-test.html b/tests/valid/draft-miek-test.html index 3a9f174e..ed3bccd4 100644 --- a/tests/valid/draft-miek-test.html +++ b/tests/valid/draft-miek-test.html @@ -16,7 +16,7 @@ This version is adapted to work with "xml2rfc" version 2.x. ' name="description"> - + @@ -26,21 +26,20 @@ diff --git a/tests/valid/draft-template.html b/tests/valid/draft-template.html index c0efd801..ec00f525 100644 --- a/tests/valid/draft-template.html +++ b/tests/valid/draft-template.html @@ -11,25 +11,24 @@ Insert an abstract: MANDATORY. This template is for creating an Internet Draft. " name="description"> - + diff --git a/tests/valid/indexes.pages.text b/tests/valid/indexes.pages.text index dfec98fa..fd662ba8 100644 --- a/tests/valid/indexes.pages.text +++ b/tests/valid/indexes.pages.text @@ -3,9 +3,9 @@ Network Working Group H. Person, Ed. -Internet-Draft April 23, 2024 +Internet-Draft July 9, 2024 Intended status: Experimental -Expires: October 25, 2024 +Expires: January 10, 2025 xml2rfc index tests @@ -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 25, 2024. + This Internet-Draft will expire on January 10, 2025. Copyright Notice @@ -53,9 +53,9 @@ Table of Contents -Person Expires October 25, 2024 [Page 1] +Person Expires January 10, 2025 [Page 1] -Internet-Draft xml2rfc index tests April 2024 +Internet-Draft xml2rfc index tests July 2024 This is another section! @@ -109,9 +109,9 @@ Index -Person Expires October 25, 2024 [Page 2] +Person Expires January 10, 2025 [Page 2] -Internet-Draft xml2rfc index tests April 2024 +Internet-Draft xml2rfc index tests July 2024 E @@ -165,4 +165,4 @@ Author's Address -Person Expires October 25, 2024 [Page 3] +Person Expires January 10, 2025 [Page 3] diff --git a/tests/valid/indexes.prepped.xml b/tests/valid/indexes.prepped.xml index 87db02ff..6decfbfc 100644 --- a/tests/valid/indexes.prepped.xml +++ b/tests/valid/indexes.prepped.xml @@ -1,6 +1,6 @@ - - + + @@ -20,7 +20,7 @@ - +
Status of This Memo @@ -41,7 +41,7 @@ material or to cite them other than as "work in progress." - This Internet-Draft will expire on 25 October 2024. + This Internet-Draft will expire on 10 January 2025.
diff --git a/tests/valid/indexes.text b/tests/valid/indexes.text index 3d654940..632356d4 100644 --- a/tests/valid/indexes.text +++ b/tests/valid/indexes.text @@ -3,9 +3,9 @@ Network Working Group H. Person, Ed. -Internet-Draft April 23, 2024 +Internet-Draft July 9, 2024 Intended status: Experimental -Expires: October 25, 2024 +Expires: January 10, 2025 xml2rfc index tests @@ -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 25, 2024. + This Internet-Draft will expire on January 10, 2025. Copyright Notice diff --git a/tests/valid/indexes.v3.html b/tests/valid/indexes.v3.html index 2ae0f8f2..b83b221a 100644 --- a/tests/valid/indexes.v3.html +++ b/tests/valid/indexes.v3.html @@ -6,7 +6,7 @@ xml2rfc index tests - + @@ -19,11 +19,11 @@ Internet-Draft xml2rfc index tests -April 2024 +July 2024 Person -Expires October 25, 2024 +Expires January 10, 2025 [Page] @@ -36,12 +36,12 @@
indexes-00
Published:
- +
Intended Status:
Experimental
Expires:
-
+
Author:
@@ -71,7 +71,7 @@

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 25, 2024.

+ This Internet-Draft will expire on January 10, 2025.

diff --git a/tests/valid/elements.bom.text b/tests/valid/elements.bom.text index 2fcf5d7e..4928cc27 100644 --- a/tests/valid/elements.bom.text +++ b/tests/valid/elements.bom.text @@ -89,8 +89,8 @@ Table of Contents Unnumbered section . . . . . . . . . . . . . . . . . . . . . . . 23 References . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Normative References . . . . . . . . . . . . . . . . . . . . . 24 - Informative References . . . . . . . . . . . . . . . . . . . . 24 - CMS References . . . . . . . . . . . . . . . . . . . . . . . 24 + Informative References . . . . . . . . . . . . . . . . . . . . 25 + CMS References . . . . . . . . . . . . . . . . . . . . . . . 25 ESS References . . . . . . . . . . . . . . . . . . . . . . . 25 MIME-SPEC References . . . . . . . . . . . . . . . . . . . . 25 Other References . . . . . . . . . . . . . . . . . . . . . . 26 @@ -1312,6 +1312,15 @@ Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018 Dreiunddreißig Gedichte + * ul with no bullets + + o Must not have an empty line with bullet above this line. + + * ul with bullets + + - + o Must have an empty line with bullet above this line. + References Normative References @@ -1329,15 +1338,6 @@ Normative References 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, . -Informative References - -CMS References - - - - - - @@ -1346,6 +1346,10 @@ Author, et al. Expires 13 January 2019 [Page 24] Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018 +Informative References + +CMS References + [I-D.levkowetz-xml2rfc-v3-implementation-notes] Levkowetz, H., "Implementation notes for RFC7991,", Work in Progress, Internet-Draft, draft-levkowetz-xml2rfc-v3- @@ -1390,10 +1394,6 @@ MIME-SPEC References RFC 2047, DOI 10.17487/RFC2047, November 1996, . - [RFC2049] Freed, N. and N. Borenstein, "Multipurpose Internet Mail - Extensions (MIME) Part Five: Conformance Criteria and - Examples", RFC 2049, DOI 10.17487/RFC2049, November 1996, - . @@ -1402,6 +1402,11 @@ Author, et al. Expires 13 January 2019 [Page 25] Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018 + [RFC2049] Freed, N. and N. Borenstein, "Multipurpose Internet Mail + Extensions (MIME) Part Five: Conformance Criteria and + Examples", RFC 2049, DOI 10.17487/RFC2049, November 1996, + . + [RFC4289] Freed, N. and J. Klensin, "Multipurpose Internet Mail Extensions (MIME) Part Four: Registration Procedures", BCP 13, RFC 4289, DOI 10.17487/RFC4289, December 2005, @@ -1445,11 +1450,6 @@ Appendix A. Some Back Matter ut sapien venenatis maximus. Morbi ut faucibus nunc, vitae pretium lorem. Aliquam sit amet tortor ut turpis dapibus ullamcorper. Proin at ligula nec magna molestie eleifend: - トヨタ 自動車 株式会社 (Toyota Jidōsha KK). - // This is a long comment line which extends well beyond the - // 72-character page width. - - @@ -1458,6 +1458,10 @@ Author, et al. Expires 13 January 2019 [Page 26] Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018 + トヨタ 自動車 株式会社 (Toyota Jidōsha KK). + // This is a long comment line which extends well beyond the + // 72-character page width. + A.1. Contributors We'd like to thank these contributors: @@ -1505,10 +1509,6 @@ Authors' Addresses - - - - Author, et al. Expires 13 January 2019 [Page 27] Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018 diff --git a/tests/valid/elements.pages.text b/tests/valid/elements.pages.text index b351ba43..439400e9 100644 --- a/tests/valid/elements.pages.text +++ b/tests/valid/elements.pages.text @@ -89,8 +89,8 @@ Table of Contents Unnumbered section . . . . . . . . . . . . . . . . . . . . . . . 23 References . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Normative References . . . . . . . . . . . . . . . . . . . . . 24 - Informative References . . . . . . . . . . . . . . . . . . . . 24 - CMS References . . . . . . . . . . . . . . . . . . . . . . . 24 + Informative References . . . . . . . . . . . . . . . . . . . . 25 + CMS References . . . . . . . . . . . . . . . . . . . . . . . 25 ESS References . . . . . . . . . . . . . . . . . . . . . . . 25 MIME-SPEC References . . . . . . . . . . . . . . . . . . . . 25 Other References . . . . . . . . . . . . . . . . . . . . . . 26 @@ -1312,6 +1312,15 @@ Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018 Dreiunddreißig Gedichte + * ul with no bullets + + o Must not have an empty line with bullet above this line. + + * ul with bullets + + - + o Must have an empty line with bullet above this line. + References Normative References @@ -1329,15 +1338,6 @@ Normative References 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, . -Informative References - -CMS References - - - - - - @@ -1346,6 +1346,10 @@ Author, et al. Expires January 13, 2019 [Page 24] Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018 +Informative References + +CMS References + [I-D.levkowetz-xml2rfc-v3-implementation-notes] Levkowetz, H., "Implementation notes for RFC7991,", Work in Progress, Internet-Draft, draft-levkowetz-xml2rfc-v3- @@ -1390,10 +1394,6 @@ MIME-SPEC References RFC 2047, DOI 10.17487/RFC2047, November 1996, . - [RFC2049] Freed, N. and N. Borenstein, "Multipurpose Internet Mail - Extensions (MIME) Part Five: Conformance Criteria and - Examples", RFC 2049, DOI 10.17487/RFC2049, November 1996, - . @@ -1402,6 +1402,11 @@ Author, et al. Expires January 13, 2019 [Page 25] Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018 + [RFC2049] Freed, N. and N. Borenstein, "Multipurpose Internet Mail + Extensions (MIME) Part Five: Conformance Criteria and + Examples", RFC 2049, DOI 10.17487/RFC2049, November 1996, + . + [RFC4289] Freed, N. and J. Klensin, "Multipurpose Internet Mail Extensions (MIME) Part Four: Registration Procedures", BCP 13, RFC 4289, DOI 10.17487/RFC4289, December 2005, @@ -1445,11 +1450,6 @@ Appendix A. Some Back Matter ut sapien venenatis maximus. Morbi ut faucibus nunc, vitae pretium lorem. Aliquam sit amet tortor ut turpis dapibus ullamcorper. Proin at ligula nec magna molestie eleifend: - トヨタ 自動車 株式会社 (Toyota Jidōsha KK). - // This is a long comment line which extends well beyond the - // 72-character page width. - - @@ -1458,6 +1458,10 @@ Author, et al. Expires January 13, 2019 [Page 26] Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018 + トヨタ 自動車 株式会社 (Toyota Jidōsha KK). + // This is a long comment line which extends well beyond the + // 72-character page width. + A.1. Contributors We'd like to thank these contributors: @@ -1505,10 +1509,6 @@ Authors' Addresses - - - - Author, et al. Expires January 13, 2019 [Page 27] Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018 diff --git a/tests/valid/elements.prepped.xml b/tests/valid/elements.prepped.xml index 53ba8a6a..7f431911 100644 --- a/tests/valid/elements.prepped.xml +++ b/tests/valid/elements.prepped.xml @@ -1,5 +1,5 @@ - + @@ -1558,6 +1558,26 @@ for opt, value in opts: +
  • + ul with no bullets +
      +
    • +
        +
      • Must not have an empty line with bullet above this line.
      • +
      +
    • +
    +
  • +
  • + ul with bullets +
      +
    • +
        +
      • Must have an empty line with bullet above this line.
      • +
      +
    • +
    +
  • diff --git a/tests/valid/elements.text b/tests/valid/elements.text index 77dce0ed..881f19fc 100644 --- a/tests/valid/elements.text +++ b/tests/valid/elements.text @@ -1101,6 +1101,15 @@ Unnumbered section Dreiunddreißig Gedichte + * ul with no bullets + + o Must not have an empty line with bullet above this line. + + * ul with bullets + + - + o Must have an empty line with bullet above this line. + References Normative References diff --git a/tests/valid/elements.v3.html b/tests/valid/elements.v3.html index aea44c5a..8daa7659 100644 --- a/tests/valid/elements.v3.html +++ b/tests/valid/elements.v3.html @@ -15,7 +15,7 @@ - + @@ -1740,6 +1740,28 @@

    Dreiunddreißig Gedichte

    + +
  • +

    ul with no bullets

    +
      +
    • +
        +
      • Must not have an empty line with bullet above this line. +
      • +
      +
    • +
    +
  • +
  • +

    ul with bullets

    +
      +
    • +
        +
      • Must have an empty line with bullet above this line. +
      • +
      +
    • +
  • diff --git a/tests/valid/elements.wip.text b/tests/valid/elements.wip.text index 1653f395..09c5d3ec 100644 --- a/tests/valid/elements.wip.text +++ b/tests/valid/elements.wip.text @@ -89,8 +89,8 @@ Table of Contents Unnumbered section . . . . . . . . . . . . . . . . . . . . . . . 23 References . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Normative References . . . . . . . . . . . . . . . . . . . . . 24 - Informative References . . . . . . . . . . . . . . . . . . . . 24 - CMS References . . . . . . . . . . . . . . . . . . . . . . . 24 + Informative References . . . . . . . . . . . . . . . . . . . . 25 + CMS References . . . . . . . . . . . . . . . . . . . . . . . 25 ESS References . . . . . . . . . . . . . . . . . . . . . . . 25 MIME-SPEC References . . . . . . . . . . . . . . . . . . . . 25 Other References . . . . . . . . . . . . . . . . . . . . . . 26 @@ -1312,6 +1312,15 @@ Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018 Dreiunddreißig Gedichte + * ul with no bullets + + o Must not have an empty line with bullet above this line. + + * ul with bullets + + - + o Must have an empty line with bullet above this line. + References Normative References @@ -1329,15 +1338,6 @@ Normative References 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, . -Informative References - -CMS References - - - - - - @@ -1346,6 +1346,10 @@ Author, et al. Expires 13 January 2019 [Page 24] Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018 +Informative References + +CMS References + [I-D.levkowetz-xml2rfc-v3-implementation-notes] Levkowetz, H., "Implementation notes for RFC7991,", Work in Progress, Internet-Draft, draft-levkowetz-xml2rfc-v3- @@ -1390,10 +1394,6 @@ MIME-SPEC References RFC 2047, DOI 10.17487/RFC2047, November 1996, . - [RFC2049] Freed, N. and N. Borenstein, "Multipurpose Internet Mail - Extensions (MIME) Part Five: Conformance Criteria and - Examples", RFC 2049, DOI 10.17487/RFC2049, November 1996, - . @@ -1402,6 +1402,11 @@ Author, et al. Expires 13 January 2019 [Page 25] Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018 + [RFC2049] Freed, N. and N. Borenstein, "Multipurpose Internet Mail + Extensions (MIME) Part Five: Conformance Criteria and + Examples", RFC 2049, DOI 10.17487/RFC2049, November 1996, + . + [RFC4289] Freed, N. and J. Klensin, "Multipurpose Internet Mail Extensions (MIME) Part Four: Registration Procedures", BCP 13, RFC 4289, DOI 10.17487/RFC4289, December 2005, @@ -1445,11 +1450,6 @@ Appendix A. Some Back Matter ut sapien venenatis maximus. Morbi ut faucibus nunc, vitae pretium lorem. Aliquam sit amet tortor ut turpis dapibus ullamcorper. Proin at ligula nec magna molestie eleifend: - トヨタ 自動車 株式会社 (Toyota Jidōsha KK). - // This is a long comment line which extends well beyond the - // 72-character page width. - - @@ -1458,6 +1458,10 @@ Author, et al. Expires 13 January 2019 [Page 26] Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018 + トヨタ 自動車 株式会社 (Toyota Jidōsha KK). + // This is a long comment line which extends well beyond the + // 72-character page width. + A.1. Contributors We'd like to thank these contributors: @@ -1505,10 +1509,6 @@ Authors' Addresses - - - - Author, et al. Expires 13 January 2019 [Page 27] Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018