Tinderbox Forum

Images and the Markdown prototype

Sorry - this must be easy to fix - but I don’t find the right door…

I try to different ways to include an image to a note that is using the Markdown prototype:

<img src="/Users/anyuser/Desktop/Screenshots/Bildschirmfoto 2021-11-01 um 16.56.54.png" width=50px>

![screenshot](/Users/anyuser/Desktop/Screenshots/Bildschirmfoto 2021-11-01 um 16.56.54.png){width=50px}

both will not show an image in preview. I got an older demo from Michael Becker and the same code shows the image (the HTML version does, the Markdown version asks for a pandoc file I don’t have).

So there has to be an attribute I forgot to set (HTMLPreviewCommand = CommonMark)?!

Any idea?

First thought you only need to use a file:// URL (i.e. percent encode the POSIX path and prefix it with file://).

Unfortunately even with this the <img src= approach doesn’t work with the Markdown prototype (but it does in a note without prototype).

Edit: It does work with the Markdown prototype if HTMLPreviewCommand is set to Markdown.

1 Like

ah - HTMLPreviewCommand was the suspect I aimed at… :wink:


1 Like

To insert an image in markdown, in a given context, inserting an HTML img src will work. The more reliable way is to use the markdown syntax for an image: ![Image Name](Image Path).

If you use Pandoc as the rendering engine, I’ve found that it will display the caption. I’ve not gotten the caption to work with Commonmark or Markdown engines. The image size {witth=" "} is also consistently rendered across the different engines.

See sample file:
TBX L - Markdown Image.tbx (87.6 KB)

1 Like