Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stories: Ordered list count broken with nested unordered list #3813

Closed
rafaelmardojai opened this issue Aug 27, 2024 · 2 comments
Closed

Stories: Ordered list count broken with nested unordered list #3813

rafaelmardojai opened this issue Aug 27, 2024 · 2 comments
Labels
fix developed release schedule to be determined upstream bug bug outside this package

Comments

@rafaelmardojai
Copy link

Description of the bug

When you use an unordered list (<ul>) inside an ordered list (<ol>) item, you get a broken count where it will count the items in the <ul> as part of the <ol>.

Example:
Captura desde 2024-08-27 16-55-56

How to reproduce the bug

Here's a small reproducer:

import fitz

HTML = """
<p>Count is fine:</p>
<ol>
    <li>Lorem
        <ol>
            <li>Sub Lorem</li>
            <li>Sub Lorem</li>
        </ol>
    </li>
    <li>Lorem</li>
    <li>Lorem</li>
</ol>

<p>Broken count:</p>
<ol>
    <li>Lorem
        <ul>
            <li>Sub Lorem</li>
            <li>Sub Lorem</li>
        </ul>
    </li>
    <li>Lorem</li>
    <li>Lorem</li>
</ol>
"""
MEDIABOX = fitz.paper_rect("A4")
WHERE = MEDIABOX + (36, 36, -36, -36)

story = fitz.Story(html=HTML)
writer = fitz.DocumentWriter("output.pdf")

more = 1

while more:
    device = writer.begin_page(MEDIABOX)
    more, _ = story.place(WHERE)
    story.draw(device)
    writer.end_page()

writer.close()

PyMuPDF version

1.24.9

Operating system

Linux

Python version

3.12

@JorjMcKie JorjMcKie added the upstream bug bug outside this package label Aug 28, 2024
@sebras
Copy link
Contributor

sebras commented Aug 28, 2024

This was reported upstream at https://bugs.ghostscript.com/show_bug.cgi?id=707989

@robinwatts robinwatts added the fix developed release schedule to be determined label Oct 31, 2024
julian-smith-artifex-com added a commit that referenced this issue Nov 1, 2024
This is addressed in mupdf master.
julian-smith-artifex-com added a commit that referenced this issue Nov 1, 2024
This is addressed in mupdf master.
julian-smith-artifex-com added a commit that referenced this issue Nov 1, 2024
This is addressed in mupdf master.
@julian-smith-artifex-com
Copy link
Collaborator

Fixed in PyMuPDF-1.24.14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix developed release schedule to be determined upstream bug bug outside this package
Projects
None yet
Development

No branches or pull requests

5 participants