Preview does not show images
CompletedImage location: /Users/MyUserName/Documents/nvUltra/images/markdown_cheatsheet.jpeg
The note is in the main nvUltra folder.
Dragging and dropping an image creates this 
Preview does not display the image.
What am I doing wrong?

-
Where is the file located?
0 -
As indicated in the first post:
/Users/MyUserName/Documents/nvUltra/images/markdown_cheatsheet.jpeg
Notes are in:
/Users/MyUserName/Documents/nvUltra
0 -
None of that includes the path and file name of the text file.
0 -
/Users/MyUserName/Documents/nvUltra/test image note.md
0 -
I re-installed nvUltra. It seems to be working now.
0 -
Based on your image path and your file path, the correct image URL would be `./nautilus.png` or `nautilus.png`, not `../nautilus.png`.
I can't make nvUltra give the incorrect one when dragging and dropping an image.
0 -
It seems to be working now. Thank you. I assume nvUltra cannot preview images outside of nvUltra folder?
0 -
Correct -- there are two issues:
1. Sandboxing in macOS means that nvUltra needs to have permission to read files. This can be granted at the folder level rather than the individual file level. In MultiMarkdown Composer, I calculate the narrowest "ancestor" folder and request permission for that folder if it has not previously been granted. That could be done in nvUltra, but....
2. Apple has deprecated `WebView` in favor of the newer `WKWebView`. Unfortunately `WKWebView` has problems with showing images (and other linked files) when previewing HTML. The best workaround Brett and I have been able to find is to run our own web server in order to serve the HTML and images that way. It is theoretically possible to have that web server serve from a different folder than is opened by the user (similar strategy as #1 above in Composer), but that makes the workflow even more complicated than it already is. With nvUltra, at this time it just makes a lot more sense to focus on serving images within the nvUltra folder and subfolders.
3. In addition, though not directly related, `WKWebView` doesn't support printing for some reason. That's why printing the preview actually uses your web browser instead.... We can only hope that at some point Apple fixes `WKWebView` if that is the recommended way to show HTML in macOS and iOS applications these days.
0 -
Hi Fletcher,
This has been an issue for a while (6+ versions) but I have not got around to posting on here—sorry. It's hard to nail down the replication. But it seems that images fail to load dynamically (you just see blue question mark boxes) if I:
1. Create a new note
2. Then create a new image
3. Then insert the image using markdown
After seeing the blue boxes, if I just switch to another file then switch back, the image will be displayed properly. In the cases where blue boxes are displayed, there doesn't seem to be anything weird about file permissions or anything like that. I even gave nvUltra full disk access (lol) and that didn't fix it. When does nvUltra (re)index images? Does the glob setting to prevent images from polluting the file list full-stop prevent reindexing on change?
My tree (where Notes is the opened folder in nvUltra) looks like:
Notes
├── 360\ 03-02-20.md
├── 475\ elmasri.md
├── Images
│ ├── Mon_Apr_13_17-33-47_PDT_2020.png
│ ├── Mon_Apr_13_17-34-06_PDT_2020.png
│ ├── Mon_Apr_20_13-30-31_PDT_2020.png
│ ├── Mon_Apr_20_16-51-59_PDT_2020.pngImages are inserted like:

Thanks and best,
Daniel
1 -
The webserver does have a short cache timeout (a minute?) to prevent re-serving the same image with every keystroke while typing with a live preview update. When you change files in the notes list, that basically shuts down the old server instance and starts a new one. So it will refresh all images.
The web server doesn't use the notes list to populate anything, so the glob settings to ignore files has no effect here.
The intent of the preview is not to serve as a "full stack web development environment", so there will be some limitations. If you add or modify a bunch of images, you can switch to a different note and back in order to reboot the web server to ensure the changes are picked up immediately, as you discovered.
0
Please sign in to leave a comment.
Comments
10 comments