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

Superscripts and the height of bullets in unordered lists in PDF output #1160

Open
1 task done
ajeanmahoney opened this issue Sep 13, 2024 · 4 comments · May be fixed by #1165
Open
1 task done

Superscripts and the height of bullets in unordered lists in PDF output #1160

ajeanmahoney opened this issue Sep 13, 2024 · 4 comments · May be fixed by #1165
Labels
bug Something isn't working pdf Issues in PDF output

Comments

@ajeanmahoney
Copy link
Collaborator

Describe the issue

When the first line of an unordered list contains a superscript, the bullets are placed higher in the PDF output. For example, the bullets for the list in Section 3.1 of RFC 9616 are higher than the ones in Section 4 in the PDF. The bullet heights are fine in the HTML output.

https://www.rfc-editor.org/rfc/rfc9616.pdf

If the list has superscripts but they are not in the first bullet item, then the placement of the bullets is okay. For example, See Section 5.2.1 of RFC 9429.

https://www.rfc-editor.org/rfc/rfc9429.pdf

The RPC does not consider this a blocking issue.

Code of Conduct

@ajeanmahoney ajeanmahoney added the bug Something isn't working label Sep 13, 2024
@kesara kesara added the pdf Issues in PDF output label Sep 16, 2024
@kesara
Copy link
Member

kesara commented Sep 16, 2024

This seems to be an WeasyPrint issue. See Kozea/WeasyPrint#2253

@kesara
Copy link
Member

kesara commented Sep 16, 2024

List items with subscript in firs line in an ordered list will suffer from the same issue.

kesara added a commit to kesara/xml2rfc that referenced this issue Sep 18, 2024
@kesara kesara linked a pull request Sep 18, 2024 that will close this issue
@kesara
Copy link
Member

kesara commented Sep 18, 2024

The proposed fix (#1165) generates the following output:
Note that this also fixes line height weirdness when the subscript is in one of the middle lines.

Section 3.1 of RFC 9616

Screenshot 2024-09-18 at 23 06 42

Section 5.2.1 of RFC 9429

Screenshot 2024-09-18 at 23 07 33

@kesara
Copy link
Member

kesara commented Sep 18, 2024

Maybe the line height should be set to 0 for the whole document not just li elements.
See Section Section 4.1 in RFC9591:
Screenshot 2024-09-18 at 23 12 46

There is a line height issue when sup elements are present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pdf Issues in PDF output
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants