diff --git a/xml2rfc/writers/text.py b/xml2rfc/writers/text.py index 94a3b7fb..9e9aeb64 100644 --- a/xml2rfc/writers/text.py +++ b/xml2rfc/writers/text.py @@ -2152,7 +2152,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', '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)