-
Notifications
You must be signed in to change notification settings - Fork 500
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 images don't work in normal table cells #295
Comments
Actually, they do work, so long as they fit within the table cell. If the image is too big to fit in the table cell, it will not show. The cell should be expanded in size to fit the image (or the restriction needs to be documented). |
...so to reproduce the issue, make the image width sufficiently large. |
Do you have an easy way to adjust the height of the cell/row? |
Not at the moment. The height adjusts based on the text content. |
I gave my answer assuming you were asking whether it's possible to set the height from AsciiDoc. I'm sure there's a way we can tell Prawn to increase the height internally. |
Hum... image: (one colon) seems to work + image:: (two colons) seems to fail. |
You are correct. One colon is an inline image, and that works in table cells (with the exception that the image must fit within the size of the cell). Two colons is a block image and that doesn't work yet because Asciidoctor PDF doesn't yet support AsciiDoc table cells. See #6. |
Even with the fix for #620 (and even #388), it seems like we have an ordering issue in the calculation. The image cell is trying to make a determination about the available space for the image and getting it wrong. I can't even quite determine how it is doing the calculation. The best workaround is to size the image so it's small enough to fit in the cell. |
Aha!!! I figured it out. When we set the font properties on the placeholder fragment, we aren't distributing the height correctly. This leads to a negative line gap, which causes the cell to not leave enough space for the image. I'll submit a patch to correct these assignments. |
…n table cell - correctly distribute font height so cell allocates enough room for inline image - incorrect distribution was leading to a negative line_gap, which was making cell too small - applies to images whose height exceeds the line height threshold
Is this issue really resolved? I am using Asciidoctor PDF 1.5.0.alpha.13 and I am experiencing exactly the same thing. I have a table with 2 columns, the first one containing an image, the second one its description. When the description is stretched across more lines, the image gets shown when it is small enough, but if its bigger, then there is an empty space even though the row itself is much higher than the text in the second column. |
Could you please retest with the latest release of Asciidoctor PDF? The latest release is 1.5.0.alpha.16. This issue was resolved in alpha.14. |
Right, my mistake, it is indeed working. Thank you for the answer. |
Inline images don't work in non-AsciiDoc table cells. Likely the callbacks for rendering inline images need to be registered specifically on the table cell so that they get invoked.
The text was updated successfully, but these errors were encountered: