yzane / vscode-markdown-pdf

Markdown converter for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=yzane.markdown-pdf
Other
1.01k stars 205 forks source link

Relative links get converted to absolute links in PDF #142

Open bryceschober opened 5 years ago

bryceschober commented 5 years ago

When I write markdown like this:

[local file](./another.md)

And then export as HTML, I get correct generation, like:

<a href="another.md">local file</a>

But when I export as PDF, it gets emitted as linking to file:///path/to/my/markdown/files/another.md. Is this something you have any control over with puppeteer, or am I out of luck?

bryceschober commented 5 years ago

I tried printing the generated HTML in Chrome and reproduced the same behavior, and found no way to work around it, so I opened https://bugs.chromium.org/p/chromium/issues/detail?id=994971

bryceschober commented 5 years ago

FYI the Chromium bug is https://bugs.chromium.org/p/chromium/issues/detail?id=931511. The previous bug I filed got resolved as a duplicate.

@yzane It sure would be nice if someone could help promote this issue from the extension developer side. I've now run into this problem with at least two different VS Code extensions that are using Puppeteer.

m10rten commented 6 months ago

I too have this issue, this makes it virtually impossible to share my generated PDF with corelated files in a .zip, because the links in the PDF will not work.

Zydiii commented 2 months ago

Is there any way to fix this?

m10rten commented 2 months ago

Is there any way to fix this?

Use word, worked for me.

Make html from md, then copy html into word.