fpdf2 icon indicating copy to clipboard operation
fpdf2 copied to clipboard

Nested HTML lists start with a newline

Open lcgeneralprojects opened this issue 1 year ago • 0 comments

Describe the bug An HTML list nested in another HTML list erroneously starts with a newline.

Minimal code Please include some minimal Python code reproducing your issue:

from fpdf import FPDF

if __name__ == '__main__':
    pdf = FPDF()
    pdf.add_page()
    pdf.write_html(f"""<ul>
        <li>First-order list item</li>
        <li><ul>
                <li>Second-order list item</li>
                <li>Second-order list item</li>
            </ul>
        </li>
    </ul>""")
    pdf.output("test_nested_lists.pdf")

Environment Please provide the following information:

  • Operating System: Windows
  • Python version: Python 3.12.2
  • fpdf2 version used: current version of the master branch of the remote repository (latest tag is 2.7.8)

lcgeneralprojects avatar Apr 22 '24 22:04 lcgeneralprojects