Defect #40642
openPDFs generated from Issues do not display images if text formatting language is Commonmark Markdown(experimental)
0%
Description
Images displayed in an issue show up in generated pdf if the text formatting language is set to textile. If it is set to CommonMark Markdown (experimental), they do not.
These images are set to display as Textile:
These images are set to display as CommonMark Markdown:
<img src="/attachments/download/32221/Image.jpg" title=".jpg image" alt=".jpg image">
<img src="/attachments/download/32222/Image.png" title=".png image" alt=".png image">
To demonstrate the problem:
Expected behavior:
Click the PDF button at the bottom right of this Issue.
The generated pdf will show the images in this description, assuming the text formatting is set to Textile.
Problem behavior:
Change the text formatting language to CommonMark Markdown (experimental)
Reload this issue.
Click the PDF button
The generated pdf will not show the images.
See issue #39692 and
Redmine 5.0.1.stable
MiniMagick available (optional)
ImageMagick convert available (optional)
ImageMagick PDF support available (optional)
System info: Linux xblgx-ops-4 5.15.0-1046-gcp #54~20.04.1-Ubuntu SMP Wed Oct 25 08:22:15
Redmine Plugin Kit: 1.0.4
Environment:
Redmine version 5.0.1.stable
Ruby version 3.0.4-p208 (2022-04-12) [x86_64-linux]
Rails version 6.1.6
Environment production
Database adapter Mysql2
Mailer queue ActiveJob::QueueAdapters::AsyncAdapter
Mailer delivery sendmail
Redmine settings:
Redmine theme Default
Files
Updated by Gary Aitken 8 months ago
Note that the markdown references to the images in the description were changed from
<img src="Image.jpg"> <img src="Image.png">
to
<img src="/attachments/download/32221/Image.jpg" title=".jpg image" alt=".jpg image"> <img src="/attachments/download/32221/Image.png" title=".png image" alt=".png image">
in the description. They should have been left as is in order to display properly in the Issue.
Updated by Gary Aitken 8 months ago
This appears to be the result of some confusion. I'm not sure how our image references originally got set to look like:
<img src="Image.jpg" width="70%">
In any case, we assumed that was the correct syntax since it displays properly in the issue.
It is not, however, proper markdown syntax; it should be:
![](Image.jpg)
When using proper syntax, the page does generate a pdf in which the images show up.
But a question remains -- since the
<img src="Image.jpg">syntax displays properly in the issue, shouldn't generation of a pdf generate something that also contains the image?
Note:
Unfortunately, neither of the options for changing the image size seem to even display properly in 5.01, let alone generate corresponding pdf:
![](Image.jpg){width=50%} ![](Image.jpg){width=100px}
Updated by Go MAEDA 4 months ago
Are you saying that when you use CommonMark Markdown and embed an image using <imge src="image.jpg">
, the image does not appear in the PDF export?
I could not reproduce that issue in my environment. The image embedded with <imge src="image.jpg">
was rendered on the PDF as expected.
Updated by Gary Aitken 4 months ago
Yes, that's what I (was) saying.
I'm going to have to investigate further. I have one instance where it doesn't work, and another where now it seems to work ok, both running the same redmine on the same ubuntu 22.04 system.
Updated by Gary Aitken 4 months ago
The problem appears to occur when there is a trailing break after the <img ... > insert:
<img src="Image.jpg"> <br>