Open alicerusso opened 2 years ago
This is caused by #788 and this occurs regardless of <figure>
is present as a parent element.
Removal of display: table;
from .alignCenter > *:first-child
in CSS is causing this issue.
Looks like new Weasyprint versions will play nicely with display: table
.
I will revert this CSS style back to display: table
when Weasyprint update (#802) is complete.
Reverting back should fix both this issue and #787.
It is possible that the right answer here is to use flexbox layout for figures, which would allow for better placement. No idea if weasyprint is able to handle that though.
In RFC 9251 (e.g., Section 9.1), XML contains artwork align="center" but the output has it left-aligned in PDF and HTML. (It's as expected in the text output.) See the first and second artworks in S9.1: https://www.rfc-editor.org/rfc/rfc9251.html#section-9.1 https://www.rfc-editor.org/rfc/rfc9251.pdf#section-9.1 https://www.rfc-editor.org/rfc/rfc9251.txt
In the prepped XML file (https://www.rfc-editor.org/rfc/rfc9251.xml), they are:
Guessing that it's supposed to yield the same alignment in all 3 outputs. (Here's the documentation for ''align''.)
Another example: see artwork in Section 3.3.4 of RFC 9260: https://www.rfc-editor.org/rfc/rfc9260.html#section-3.3.4-7.16.3 (left aligned) vs. https://www.rfc-editor.org/rfc/rfc9260.txt (centered, as expected) (This issue occurs with other artwork elements within that document, but it's more obvious when the artwork is narrow.)
Perhaps this issue only occurs when
<artwork>
is not within<figure>
bc there are examples where the 3 outputs match (when XML contains artwork align="center"), e.g., Figure 1 in https://www.rfc-editor.org/rfc/rfc9174.html, Figure 1 in https://www.rfc-editor.org/rfc/rfc9125.html, Figure 1 in https://www.rfc-editor.org/rfc/rfc9182.html.