Bug 406334 - Markdown addon: embedded images (attached to the email) are not displayed
Summary: Markdown addon: embedded images (attached to the email) are not displayed
Status: REOPENED
Alias: None
Product: kdepim
Classification: Applications
Component: messagecomposer (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-08 14:46 UTC by avlas
Modified: 2023-03-27 21:55 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.12.0


Attachments
File to test markdown format conversion (1.73 KB, text/markdown)
2019-04-16 11:51 UTC, avlas
Details
File of github style for markdown conversion (11.04 KB, text/css)
2019-04-16 11:52 UTC, avlas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description avlas 2019-04-08 14:46:49 UTC
The following example:

Some text in markdown format
![an image embedded within the text](image.png)
Some more text in markdown format

should ideally display "image.png" embedded within the text (if attached in the email, of course).
Comment 1 avlas 2019-04-15 13:05:11 UTC
I tested this in Discount and works as expected, embedding the image within other markdown content. Could you please consider adding this option?
Comment 2 Laurent Montel 2019-04-15 17:38:19 UTC
option for what ?
Generating a image.png ?
Comment 3 avlas 2019-04-15 22:47:34 UTC
(In reply to Laurent Montel from comment #2)
> option for what ?
> Generating a image.png ?

I meant for adding images within context. Imaging you write a markdown email and you refer to one or more images in the body of the email. Discount allows to generate an html version of it that embeds the referenced image in its right place.

It would be great if Kmail would benefit from this, so referenced images are embedded in the right places of the email body. For this, Kmail would need to be smart enough to know where to find the image (that needs of course to be attached to the email).

I hope I was clearer this time :)
Comment 4 Laurent Montel 2019-04-16 11:29:22 UTC
Git commit 767d21f55ef2447f67790c033762c51a4d6e1ff1 by Laurent Montel.
Committed on 16/04/2019 at 11:27.
Pushed by mlaurent into branch 'master'.

Add method for generating image markdown string.

For the moment it doesn't add image in mail

M  +2    -0    kmail/editorconvertertextplugins/markdown/CMakeLists.txt
M  +4    -2    kmail/editorconvertertextplugins/markdown/autotests/CMakeLists.txt
A  +46   -0    kmail/editorconvertertextplugins/markdown/autotests/markdowncreateimagedialogtest.cpp     [License: LGPL (v2+)]
A  +35   -0    kmail/editorconvertertextplugins/markdown/autotests/markdowncreateimagedialogtest.h     [License: LGPL (v2+)]
A  +59   -0    kmail/editorconvertertextplugins/markdown/autotests/markdowncreateimagewidgettest.cpp     [License: LGPL (v2+)]
A  +36   -0    kmail/editorconvertertextplugins/markdown/autotests/markdowncreateimagewidgettest.h     [License: LGPL (v2+)]
A  +52   -0    kmail/editorconvertertextplugins/markdown/markdowncreateimagedialog.cpp     [License: LGPL (v2+)]
A  +36   -0    kmail/editorconvertertextplugins/markdown/markdowncreateimagedialog.h     [License: LGPL (v2+)]
A  +52   -0    kmail/editorconvertertextplugins/markdown/markdowncreateimagewidget.cpp     [License: LGPL (v2+)]
A  +38   -0    kmail/editorconvertertextplugins/markdown/markdowncreateimagewidget.h     [License: LGPL (v2+)]
M  +14   -0    kmail/editorconvertertextplugins/markdown/markdowninterface.cpp
M  +1    -0    kmail/editorconvertertextplugins/markdown/markdowninterface.h

https://commits.kde.org/kdepim-addons/767d21f55ef2447f67790c033762c51a4d6e1ff1
Comment 5 Laurent Montel 2019-04-16 11:32:27 UTC
(In reply to avlas from comment #1)
> I tested this in Discount and works as expected, embedding the image within
> other markdown content. Could you please consider adding this option?

How did you test it ?
Could you give me your command line ?
thanks
Comment 6 avlas 2019-04-16 11:51:22 UTC
Created attachment 119432 [details]
File to test markdown format conversion
Comment 7 avlas 2019-04-16 11:51:47 UTC
(In reply to Laurent Montel from comment #5)
> (In reply to avlas from comment #1)
> > I tested this in Discount and works as expected, embedding the image within
> > other markdown content. Could you please consider adding this option?
> 
> How did you test it ?
> Could you give me your command line ?
> thanks

I do: 

mkd2html -G -css github.css mainTest.md mainTest_github.html
Comment 8 avlas 2019-04-16 11:52:32 UTC
Created attachment 119433 [details]
File of github style for markdown conversion
Comment 9 avlas 2019-04-16 11:56:31 UTC
In addition to the github css style (that I attached) I have another css file from markdown-here. The one I use (and like the most) is the github one, with single exception, the background color that is used in the title row of tables, which is taken from markdown-here.

It would be ideal to, for instance, use the github style by default but allow the final user to add a specific css file in settings, if desired.
Comment 10 avlas 2019-04-16 11:57:34 UTC
(In reply to avlas from comment #7)
> (In reply to Laurent Montel from comment #5)
> > (In reply to avlas from comment #1)
> > > I tested this in Discount and works as expected, embedding the image within
> > > other markdown content. Could you please consider adding this option?
> > 
> > How did you test it ?
> > Could you give me your command line ?
> > thanks
> 
> I do: 
> 
> mkd2html -G -css github.css mainTest.md mainTest_github.html

Forgot to say about the image, which I didn't attach (as it may have copyright). Please change it by one that you have to test.
Comment 11 Laurent Montel 2019-04-16 11:59:55 UTC
Thanks I will continue to implement it today or tomorrow
Comment 12 avlas 2019-04-16 12:03:02 UTC
(In reply to Laurent Montel from comment #11)
> Thanks I will continue to implement it today or tomorrow

Thank you very much! If you implement all these enhancements, it's going to be amazing!
Comment 13 Laurent Montel 2019-04-25 07:11:58 UTC
Git commit 137430312149daa2a95109160d236ad7c70d14a6 by Laurent Montel.
Committed on 25/04/2019 at 07:11.
Pushed by mlaurent into branch 'master'.

Fix Bug 406334 - Markdown addon: embedded images (attached to the email) are not displayed
FIXED-IN: 5.12.0

M  +6    -5    kmail/editorconvertertextplugins/markdown/markdowninterface.cpp

https://commits.kde.org/kdepim-addons/137430312149daa2a95109160d236ad7c70d14a6
Comment 14 avlas 2019-04-25 10:53:19 UTC
(In reply to Laurent Montel from comment #13)
> Git commit 137430312149daa2a95109160d236ad7c70d14a6 by Laurent Montel.
> Committed on 25/04/2019 at 07:11.
> Pushed by mlaurent into branch 'master'.
> 
> Fix Bug 406334 - Markdown addon: embedded images (attached to the email) are
> not displayed
> FIXED-IN: 5.12.0
> 
> M  +6    -5   
> kmail/editorconvertertextplugins/markdown/markdowninterface.cpp
> 
> https://commits.kde.org/kdepim-addons/
> 137430312149daa2a95109160d236ad7c70d14a6

Great, thanks!

Do you think there could be a way to apply styling? I think it would be the last missing piece
Comment 15 Laurent Montel 2019-04-25 11:59:45 UTC
(In reply to avlas from comment #14)
> (In reply to Laurent Montel from comment #13)
> > Git commit 137430312149daa2a95109160d236ad7c70d14a6 by Laurent Montel.
> > Committed on 25/04/2019 at 07:11.
> > Pushed by mlaurent into branch 'master'.
> > 
> > Fix Bug 406334 - Markdown addon: embedded images (attached to the email) are
> > not displayed
> > FIXED-IN: 5.12.0
> > 
> > M  +6    -5   
> > kmail/editorconvertertextplugins/markdown/markdowninterface.cpp
> > 
> > https://commits.kde.org/kdepim-addons/
> > 137430312149daa2a95109160d236ad7c70d14a6
> 
> Great, thanks!
> 
> Do you think there could be a way to apply styling? I think it would be the
> last missing piece

It's still on my todo list (+ some others fix/improvement)

See you if I will find a fix for it too :)
Comment 16 avlas 2019-04-25 12:20:46 UTC
(In reply to Laurent Montel from comment #15)
> (In reply to avlas from comment #14)
> > (In reply to Laurent Montel from comment #13)
> > > Git commit 137430312149daa2a95109160d236ad7c70d14a6 by Laurent Montel.
> > > Committed on 25/04/2019 at 07:11.
> > > Pushed by mlaurent into branch 'master'.
> > > 
> > > Fix Bug 406334 - Markdown addon: embedded images (attached to the email) are
> > > not displayed
> > > FIXED-IN: 5.12.0
> > > 
> > > M  +6    -5   
> > > kmail/editorconvertertextplugins/markdown/markdowninterface.cpp
> > > 
> > > https://commits.kde.org/kdepim-addons/
> > > 137430312149daa2a95109160d236ad7c70d14a6
> > 
> > Great, thanks!
> > 
> > Do you think there could be a way to apply styling? I think it would be the
> > last missing piece
> 
> It's still on my todo list (+ some others fix/improvement)
> 
> See you if I will find a fix for it too :)

Very much appreciated!
Comment 17 Laurent Montel 2019-04-29 19:00:09 UTC
now we can define the size of image (using =<width>x<height>)
Comment 18 avlas 2019-04-29 23:24:31 UTC
(In reply to Laurent Montel from comment #17)
> now we can define the size of image (using =<width>x<height>)

Nice!
Comment 19 avlas 2020-05-06 22:36:33 UTC
(In reply to Laurent Montel from comment #13)
> Git commit 137430312149daa2a95109160d236ad7c70d14a6 by Laurent Montel.
> Committed on 25/04/2019 at 07:11.
> Pushed by mlaurent into branch 'master'.
> 
> Fix Bug 406334 - Markdown addon: embedded images (attached to the email) are
> not displayed
> FIXED-IN: 5.12.0
> 
> M  +6    -5   
> kmail/editorconvertertextplugins/markdown/markdowninterface.cpp
> 
> https://commits.kde.org/kdepim-addons/
> 137430312149daa2a95109160d236ad7c70d14a6

Not sure there has been a regression of some sort, but attached images are not displayed in markdown formatted html emails.
Comment 20 Laurent Montel 2020-05-07 05:02:27 UTC
(In reply to avlas from comment #19)
> (In reply to Laurent Montel from comment #13)
> > Git commit 137430312149daa2a95109160d236ad7c70d14a6 by Laurent Montel.
> > Committed on 25/04/2019 at 07:11.
> > Pushed by mlaurent into branch 'master'.
> > 
> > Fix Bug 406334 - Markdown addon: embedded images (attached to the email) are
> > not displayed
> > FIXED-IN: 5.12.0
> > 
> > M  +6    -5   
> > kmail/editorconvertertextplugins/markdown/markdowninterface.cpp
> > 
> > https://commits.kde.org/kdepim-addons/
> > 137430312149daa2a95109160d236ad7c70d14a6
> 
> Not sure there has been a regression of some sort, but attached images are
> not displayed in markdown formatted html emails.

Test case ?
For me it seems working here.
Comment 21 avlas 2020-05-08 19:32:26 UTC
(In reply to Laurent Montel from comment #20)
> (In reply to avlas from comment #19)
> > (In reply to Laurent Montel from comment #13)
> > > Git commit 137430312149daa2a95109160d236ad7c70d14a6 by Laurent Montel.
> > > Committed on 25/04/2019 at 07:11.
> > > Pushed by mlaurent into branch 'master'.
> > > 
> > > Fix Bug 406334 - Markdown addon: embedded images (attached to the email) are
> > > not displayed
> > > FIXED-IN: 5.12.0
> > > 
> > > M  +6    -5   
> > > kmail/editorconvertertextplugins/markdown/markdowninterface.cpp
> > > 
> > > https://commits.kde.org/kdepim-addons/
> > > 137430312149daa2a95109160d236ad7c70d14a6
> > 
> > Not sure there has been a regression of some sort, but attached images are
> > not displayed in markdown formatted html emails.
> 
> Test case ?
> For me it seems working here.

Please see: https://i.imgur.com/moqaQSv.png

The image is missing and if I send the email anyway, I cannot find the image in the resulting email
Comment 22 Laurent Montel 2020-05-22 12:05:50 UTC
I confirm it.
I will investigate it
Comment 23 avlas 2020-05-22 12:12:36 UTC
(In reply to Laurent Montel from comment #22)
> I confirm it.
> I will investigate it

Thank you
Comment 24 avlas 2023-03-27 21:55:01 UTC
I still can reproduce the issue