Project

General

Profile

Actions

Defect #40642

open

PDFs generated from Issues do not display images if text formatting language is Commonmark Markdown(experimental)

Added by Gary Aitken 15 days ago. Updated 14 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Issues
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

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:
.jpg image
.png image

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

Image.jpg (19.5 KB) Image.jpg .jpg image Gary Aitken, 2024-04-28 18:20
Image.png (3.76 KB) Image.png .png image Gary Aitken, 2024-04-28 18:20
Actions #1

Updated by Gary Aitken 15 days 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.

Actions #2

Updated by Gary Aitken 14 days 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}

Actions

Also available in: Atom PDF