Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preview window can't show the local image #5

Open
asmwarrior opened this issue Jan 9, 2019 · 7 comments
Open

preview window can't show the local image #5

asmwarrior opened this issue Jan 9, 2019 · 7 comments

Comments

@asmwarrior
Copy link

Hi, if I have a file named "text.md", and a file "a.png" is put in the same folder of this markdown.

![a](a.png)

This code does not show the image in the preview window, can you enable this? I think the local image(usually they have relative path to the md file) should be shown correctly.

Thanks.

@mb21
Copy link
Owner

mb21 commented Jan 9, 2019

This works for me as well, but probably has to do with Windows backslashes or something like that.

In PanWriter, can you try View -> Toggle Developer Tools and see whether you can find the iframe that's used for the preview and see whether it contains a base tag like <base href=""> in the <head>? That base tag should be set to point to your current directory.

@mb21
Copy link
Owner

mb21 commented Jan 12, 2019

I just tested on a Windows 10 VM and it worked fine for me.

If you can reproduce this, let me know... and what your <base> tag looks like.

@mb21 mb21 closed this as completed Jan 12, 2019
@achimwagenknecht
Copy link

achimwagenknecht commented Sep 7, 2022

I can reproduce this error on my Windows 10 VM.
Editor: ![*Klicken Sie hier*](01.png)
Preview: broken image
DevTools: <img src="file:///01.png">

I tried the following without success:

  • removed the file:///
  • added <base> tag in header of iframe with absolute path
  • added <base> tag in header of iframe with .

@mb21 mb21 reopened this Sep 8, 2022
@achimwagenknecht
Copy link

Thank you for reopening. Now I encounter the same error on Linux as well... But here the error is easily fixed: There was a space character in the file's path. Removed it, now it works. Tried the same solution on Windows, but unfortunately it doesn't do the trick. I also looked for other special characters in the path but did not find any.

@Moonbase59
Copy link

Moonbase59 commented Feb 4, 2023

Linux Mint 21.1 & Panwriter AppImage 0.8.5 here: Images don’t display if there is a blank anywhere in the path of the generated file://… link. I like this project but this makes it rather unusable for me, because I can’t change my existing folder structures (using lots of UTF-8 characters and blanks in the folder names).

Test_005

Test_006

Maybe it’s just a problem of URL-encoding. I seem to remember when there was a blank in the path (as in "Panwriter Test"), it tried to make a file://… link having a %20.

Also, if you look closely at the second screenshot, it generates an extra slash in the file://… link between the path and the image name part: file:///home/matthias/Dokumente/Panwriter-Test//Moonbase-new-Logo.svg.

@mb21
Copy link
Owner

mb21 commented Feb 4, 2023

@Moonbase59 The spaces in the url not working seems to be correct behaviour according to Commonmark, see e.g. this example. You should be able to use %20 instead of a space.

About the double slash between folder and image name: thanks, should be fixed with 1665eab

@Darthagnon
Copy link

I'm seeing the same issue: relative images do not render on Windows. They render fine in Notepad++ using https://github.com/mohzy83/NppMarkdownPanel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants