otterwiki icon indicating copy to clipboard operation
otterwiki copied to clipboard

Relative links without a "./" work in preview but not when saved

Open mattock opened this issue 10 months ago • 1 comments

There is inconsistency in how relative links are rendered in "Preview" and when saved:

  1. This does not render at all: ![01-tray-icon.png](01-tray-icon.png)
  2. This renders correctly: ![01-tray-icon.png](./01-tray-icon.png)
  3. This renders correctly: ![01-tray-icon.png](/Pages/OpenVPN-GUI-New/01-tray-icon.png)

The images are attached to the wiki page, i.e. are at the path shown on third line above.

Here's a screenshot of an image URL that does not render (1, above) followed by a working one (2 or 3, above):


Image


mattock avatar Feb 11 '25 07:02 mattock

Hey @mattock, thanks for reporting this.

This a known bug (or non-feature 🤔).

Due to the preview being on the url /Page/edit an attachment on the page with ![example.png](example.png) becomes /Page/example.png which works ... in the Preview and not on /Page.

I'm a little afraid of adding extra magic here, I'm not even happy with the ./example.png solution, because this wont work if you clone the wiki with git and work in local files, since the correct code in a Page.md would be [Page/example.png](..)

redimp avatar Feb 11 '25 16:02 redimp