swiftDialog icon indicating copy to clipboard operation
swiftDialog copied to clipboard

Markdown inline images do not support paths to local image files, only http[s] urls

Open glenfarclas17 opened this issue 3 years ago • 3 comments

I just downloaded v2.0 to start playing around with swiftDialog - thanks for the amazing work!

I just wanted to report this issue I found pretty quickly:

The CommonMark Spec seems to indicate that the source for inline images can be a local file, and a relative or absolute path can be used. However when I try this

dialog --title 'Helllo World' --message "\![foo](/path/to/a/local/file.png)" 

or a multiline version

read -r -d '' msg <<'EOF'
This is the line _above_ the image  
![foo](/path/to/a/local/file.png)  
This is the line **below** the image
EOF

dialog --title 'Helllo World' --message "$msg" 

The image is never shown.

Allowing this would let me use markdown to have both a message and an image at the same time.

Thanks so much! -Chris

glenfarclas17 avatar Nov 18 '22 00:11 glenfarclas17

correct - that's a limitation in MarkdownUI for reading images that are not inside the application bundle

https://github.com/gonzalezreal/MarkdownUI/issues/46

It's something that I'm actively looking at though to see if there's a workaround which at this stage looks like either alternates to MarkdownUI, or implement built in markdown support if running on macOS 12 or newer

bartreardon avatar Nov 18 '22 00:11 bartreardon

Ahh I was wondering if it was an issue in the markdown lib or not - thanks for responding and I hope a workaround is easy to find and implement.

Cheers, -Chris

glenfarclas17 avatar Nov 18 '22 00:11 glenfarclas17

@glenfarclas17 You beat me to posting this. I found the same thing when playing around with adding images using Marrkdown. I'm glad I'm not the only one that would find it useful to be able to use a local image file path in this way. It would actually somewhat satisfy the FR I just posted earlier today. See Issue #194

mm2270 avatar Nov 18 '22 04:11 mm2270

closing as I don't think this is going to be resolved within markdownUI

bartreardon avatar Sep 16 '24 12:09 bartreardon