Skip to content

Commit

Permalink
fix: Insert a new line to li rahter than skipping
Browse files Browse the repository at this point in the history
  • Loading branch information
kesara committed Jul 10, 2024
1 parent fdb6fb8 commit e889f93
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions xml2rfc/writers/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e889f93

Please sign in to comment.