-
-
Notifications
You must be signed in to change notification settings - Fork 675
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
Inline-block ignores its padding/border/margin when calculating its max width #1235
Comments
As a workaround, I tried adding this to the Markdown:
Documents: samples3-inline-css.zip In the HTML version, that gives me what I want: However, the PDF is unchanged. It seems like the |
Hello! This problem is fun 😄. Lines are split, but it’s not a bug, it’s a feature. The stylesheet from your document has this rule, that only applies for print: @media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em }
} The The second rule, We have a bug in WeasyPrint. The spans, displayed as inline blocks, have a content width of 100%, ignoring their left padding (that should set their size to 100% - 5em instead, to have a padding-box width of 100%). So, the text is 5em too wide, making it disappear on the right. I’ll try to create a very small example showing the problem. |
<span style="background: red; display: inline-block; margin: 0 100px">a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h a b c d e f g h </span> |
This is a follow-up from #1234. Context:
--pdf-engine
Using the latest WeasyPrint master code, the PDF does wrap long lines in code blocks, but each line is cut off prematurely, and there are some extra blank lines after the last wrapped line.
Documents produced by above Github workflow: samples2.zip
HTML:
PDF:
The text was updated successfully, but these errors were encountered: