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 doesn't render local images #25

Closed
skiprca opened this issue Feb 8, 2019 · 8 comments
Closed

Preview doesn't render local images #25

skiprca opened this issue Feb 8, 2019 · 8 comments
Labels
addition An addition to an existing feature

Comments

@skiprca
Copy link

skiprca commented Feb 8, 2019

Hello!

I can't find a way for local image to render properly in preview window.

I use three files for testing:

/Users/johndoe/tmp/aaa.md 
/Users/johndoe/tmp/aaa.png
/Users/johndoe/tmp/aaa/aaa.png - for testing relative subfolder

Nothing of the following seems to work:

![test png 1](aaa.png)
![test png 2](aaa/aaa.png)
![test png 3](file:///Users/johndoe/tmp/aaa.png)
<img src="aaa.png" alt="test png 4">
<img src="aaa/aaa.png" alt="test png 5">

Web link works as it should:

![web png](https://johndoe.com/aaa.png)

I tried to preview same aaa.md in MacDown and it works for all cases.

Am I missing something?

Thank you for your time,
Aljoša

@lukakerr
Copy link
Owner

lukakerr commented Feb 8, 2019

This is a known bug/missing feature. Unfortunately WKWebView doesn't make it easy to include local assets (including images). I believe MacDown is using the old WebView which makes this easier

@skiprca
Copy link
Author

skiprca commented Feb 9, 2019 via email

@lukakerr
Copy link
Owner

lukakerr commented Feb 9, 2019

@skiprca If your keen then definitely have a go to try and fix it, thanks! I was planning on getting to it some time in the future, but haven't had much time to work on it recently unfortunately

@lukakerr lukakerr added help wanted Extra attention is needed addition An addition to an existing feature labels Feb 13, 2019
@lukakerr
Copy link
Owner

I've begun work on this in #32, but as you can read in the PR, there is a small problem i'm facing. If I can't solve it in the next few days, i'll merge the PR in anyway.

@noestreich
Copy link

noestreich commented Feb 19, 2019

Just stumbled on entry #32 after unsuccessfully trying to get image preview to load. Glad you already started implementing it.

If i may add two comments and a feature-wish:

  • Since you just showed markdown-syntax in your screenshot-preview, it would be great if <img src=""> would also be supported.
  • i would greatly appreciate an easy possibility to insert an empty markdown image-tag ![]() with a shortcut. (for example: Macdown uses Command+Shift+I)
  • A quick and easy way to define image size (really important for PDF-Export) would be great. Something similar was already wished for for macdown before they ceased development. I quote:

"If there is a way to implement the syntax ![](pic/location/url =200x) like Mou, or just add an alternative way of Command+Shift+I to input <img src="" width=""> directly."

Thanks a bunch!

@lukakerr
Copy link
Owner

@noestreich regarding the feature wish list:

@noestreich
Copy link

Perfect and reasonable reply all around. Thanks for the fast feedback! Looking forward to use the image preview.

@lukakerr
Copy link
Owner

lukakerr commented Feb 19, 2019

The issue in #32 has been fixed! A good nights sleep always resolves any problems. I also implemented both markdown and HTML image shortcuts.

  • For a markdown image, the shortcut is Command+Shift+I
  • For a HTML image, the shortcut is Control+Shift+I

These new shortcuts and the new local image feature will be included in the next release. If there are any issues with images not appearing, please raise a new issue.

@lukakerr lukakerr removed the help wanted Extra attention is needed label Feb 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition An addition to an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants