As discussed in MarkEdit-app/MarkEdit#1310, relative links like [Title](../assets/image.png) (starts with ../) currently do not work in preview mode—clicking them results in a no-op.
The root cause is that these URLs are interpreted as http://localhost/assets/image.png, so the .. segment is not respected.
We need to delegate such links to native methods using MarkEdit.getFileInfo and MarkEdit.openFile (see https://github.com/MarkEdit-app/MarkEdit-api/blob/main/index.d.ts).
A few things to consider:
- Can this be handled cleanly via
markdown-it customization?
- Is there a better approach than overriding click events on
<a> elements?
As discussed in MarkEdit-app/MarkEdit#1310, relative links like
[Title](../assets/image.png)(starts with../) currently do not work in preview mode—clicking them results in a no-op.The root cause is that these URLs are interpreted as
http://localhost/assets/image.png, so the..segment is not respected.We need to delegate such links to native methods using
MarkEdit.getFileInfoandMarkEdit.openFile(see https://github.com/MarkEdit-app/MarkEdit-api/blob/main/index.d.ts).A few things to consider:
markdown-itcustomization?<a>elements?