diff --git a/xml2rfc/writers/text.py b/xml2rfc/writers/text.py index 378ca9ac..4d2d1667 100644 --- a/xml2rfc/writers/text.py +++ b/xml2rfc/writers/text.py @@ -2150,11 +2150,10 @@ 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") - ): + children = e.getchildren() + if children and children[0].tag in ["artwork", "figure", "sourcecode", "ol", "ul"]: + lines.insert(0, Line(text.rstrip(stripspace), e)) + else: lines[0].text = text + lines[0].text.lstrip(stripspace) else: text += tt.lstrip(stripspace)