bug: Links to images now contain http://localhost:port prefix when using --as-html flag
MarshalX opened this issue · 5 comments
Context: I use HTML snippets in my markdown. Previously it worked fine and didn't touch src
attr. Now it modifies it.
- version (
md-to-pdf -v
): 4.0.0 - platform (Unix, macOS, Windows): macOS
- node version: 15.12/16
Describe the bug:
Starting from ~July the behavior of HTML output has been changed.
This is what I have in my MD file:
<img alt="GitHub" class="align-middle" height="16" src="icons/dark/github.svg">
This is what I get in HTML output:
<img alt="GitHub" class="align-middle" height="16" src="http://localhost:60331/icons/dark/github.svg">
This is the command that I use:
md-to-pdf --as-html --config-file config/html.js Ilya_Siamionau_CV.md
I locked npm version, I locked md-to-pdf version. CI worked fine 2 months ago, but now fails.
Project (with html.js config): https://github.com/MarshalX/cv/tree/a6d62eb475d3e68f4c9b878826eeacea626d7067
Success CI run: https://github.com/MarshalX/cv/actions/runs/5567446756
Failed CI run: https://github.com/MarshalX/cv/actions/runs/6266508744
After upgrading node to 16 I have described bug. Probably not related to this project and thanks to deps, but just want to inform you in case you are interested.
hm ok that's weird, i agree they should be relative links. maybe it's from upgrading marked
? can you check which version you were using when it worked and now (if you have a lockfile e.g. package-lock.json
committed you should be able to tell from there).
btw just an idea but can you try
<img alt="GitHub" class="align-middle" height="16" src="/icons/dark/github.svg">
i.e. prefix the src
path with a /
?
btw just an idea but can you try
<img alt="GitHub" class="align-middle" height="16" src="/icons/dark/github.svg">
i.e. prefix the
src
path with a/
?
yep that was my try before making dirty hacks xd doesnt work
hm ok that's weird, i agree they should be relative links. maybe it's from upgrading
marked
? can you check which version you were using when it worked and now (if you have a lockfile e.g.package-lock.json
committed you should be able to tell from there).
Unfortunately, im using cli and global installation... there is not package-lock
npm i -g md-to-pdf@4.0.0
closed because it's bug of md-to-pdf