From fdb6fb8ad2024b3483f7480a07f8370e673c27e2 Mon Sep 17 00:00:00 2001 From: Kesara Rathnayake Date: Wed, 10 Jul 2024 06:41:44 +1200 Subject: [PATCH] fixup! fix: Render ol items correctly --- xml2rfc/writers/text.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xml2rfc/writers/text.py b/xml2rfc/writers/text.py index 82e9a9d7..378ca9ac 100644 --- a/xml2rfc/writers/text.py +++ b/xml2rfc/writers/text.py @@ -2150,9 +2150,11 @@ 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'] and - not (p.tag == 'ul' and lines[0].elem.tag == '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)