Skip to content

Relative links outside "root" #85

@cyanzhong

Description

@cyanzhong

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:

  1. Can this be handled cleanly via markdown-it customization?
  2. Is there a better approach than overriding click events on <a> elements?

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions