nea / MarkdownViewerPlusPlus

A Notepad++ Plugin to view a Markdown file rendered on-the-fly
MIT License
1.17k stars 143 forks source link

Local image not displayed when export as HTML/PDF file #50

Open anti-destiny opened 6 years ago

anti-destiny commented 6 years ago

I notice that you have fixed the bug mentioned in Issue #23. I tryed to use ![png](file:///imagepath) to display my image, and in notepad++, the image displayed well. However, when I clicked the export button to convert markdown file to html, the image didn't appear in my browser, and the html code is <img src="file:///./output_1_1.png" alt="png">.

Pyroseza commented 6 years ago

I'm having this same problem, I would love to export local files to PDF and HTML without having to upload them somewhere.

andrzejQ commented 6 years ago

"You have to add the protocol file:/// in front of every reference, otherwise it is not detected. "

It is working well with absolute path to file in MV++ and Firefox 57+. But absolute path is not reasonable practice for documentation. Relative path, like ![xyz](file:///./xyz.png) is working in MV++, but not in FF 57+. And ![xyz](./xyz.png) is working in FF 57+, but not in MV++, so it would be great if

](./

in MV++ would be equivalent to:

](file:///./

and

<img src="./

in MV++ would be equivalent to (working well in MV++):

<img src="file:///./
nea commented 6 years ago

That's a god comparison @andrzejQ. Thanks for the hint.

heydojo commented 6 years ago

+1 Please add an option to embed images into exported pdf documents. Thanks. Great plugin.

andrzejQ commented 5 years ago

I think that release
https://github.com/andrzejQ/MarkdownViewerPlusPlus/releases/tag/0.8.202
solves the problem... ... solves the problem with viewing and HTML export. PDF could be created as HTML print to PDF

matteoturra commented 5 years ago

Images are not embedded in pdf export with relative nor with absolute path. I have rel. 0.8.2.25564

brokengillou commented 5 years ago

Hi,

Sorry for arguing but i'm not getting any improvement in any way. Viewing is perfect but I've been able neither exporting or printing images with relative path:

![alt-text](file://<relative path>/image.png "image-title")
![alt-text](file:///<relative path>/image.png "image-title")
![alt-text](file:///./<relative path>/image.png "image-title")

What did work for Html export, is an absolute link with proper URL encode:

![alt-text](file:///<bloody long absolute path>/image.png "image-title")

Not working for Pdf export.

Finally, i verified image export with an external link:

![alt-text](https://<somewhere>/mdh-logo-new.png "image-title")

It's working perfectly for Html and Pdf...

Using: Windows 10 Notepad++ v7.5.9 MarkdownViewer++ v0.8.2.25525

Greetings,

Gilles

thmasker commented 5 years ago
![alt-text](https://<somewhere>/mdh-logo-new.png "image-title")

It's working perfectly for Html and Pdf...

Using: Windows 10 Notepad++ v7.5.9 MarkdownViewer++ v0.8.2 (latest release, not sure if it is .25525...)

and images don't export neither for HTML nor PDF.

stefan123t commented 2 years ago

Just tried with 0.8.2.25525 and can confirm the issue still exists.

I have seen the code change suggested by Maarten @Wallby in #134 which looks interesting. I do not know if his change will fix both preview and html/pdf export though.