Skip to content

Offer the ability to create relative references to image files #2560

Closed

Description

@fgimian

Describe your feature request

Continuing on from the discussion in #549

Typora has an option "Use relative path if possible" which is critical. It will insert a relative path to the file instead of an absolute path when it is stored in a relative path such as "assets". This means that if you move the document and its images to a different location, images continue to work. Mark Text only seems to insert absolute paths which makes it very hard to move things around.

What problem does this feature solve? [optional]

It makes it possible to easily move and share documents with their related images.

Additional context [optional]

You can see the related option in Typora title "Use relative path if possible" below:

image

With this setup, if I were to paste a screenshot into an example document, it would render:

![Screenshot (1)](Testing.assets/Screenshot (1).png)

Meanwhile Mark Text would render something like:

![Screenshot (1).png](C:\Users\Fots\Documents\Wiki\assets\b5a959a24be0f855c0e7e64ba3fa213d76e2ccbe.png)

Activity

  1. wernerdaehn commented on Apr 23, 2021

    @wernerdaehn

    Yes, huge problem. You paste an image into the document (relative path is "./assets/"), then push it to github and the image cannot be found as the server does not know the absolute path for sure.

  2. teopost commented on May 5, 2021

    @teopost

    +1

  3. carmolim commented on May 13, 2021

    @carmolim

    +1

  4. carmolim commented on May 13, 2021

    @carmolim

    +1

  5. Lulu300 commented on Jun 4, 2021

    @Lulu300

    +1

  6. ytianxia6 commented on Nov 30, 2021

    @ytianxia6

    +1
    So is there a plan to solve this problem?

  7. YalandHong commented on Nov 30, 2021

    @YalandHong

    It's strange. The developer said:

    A relative path should be used if the file is persistent on disk.

    But I can't figure out how to do so. MarkText always uses absolute path.

  8. YalandHong commented on Nov 30, 2021

    @YalandHong

    +1 So is there a plan to solve this problem?

    Unfortunately I don't think there's any explicit plan to implement this feature. So, currently it may be quite a pain, especially for Typora users, if you want to insert a bunch of images in your documents.

  9. ytianxia6 commented on Nov 30, 2021

    @ytianxia6

    I think that even if it is not possible to support the automatic use of relative paths, it should support the resolution of relative paths, or at least manually change them to relative paths.
    But now when you manually change to a relative path, the picture cannot be displayed.

  10. YalandHong commented on Dec 2, 2021

    @YalandHong

    Also related to #2652

  11. fxha commented on Dec 22, 2021

    @fxha
    Contributor

    You can select this behavior via Settings -> Image. Select "Move to designated local folder" and activate "Prefer relative assets folder". But I think the current stable version has a bug that this may fail that was already fixed on develop.

    Relative to file is duplicate of #2559.

  12. fgimian commented on Jan 19, 2022

    @fgimian
    Author

    I can confirm this works perfectly in the latest develop version, thanks!

  13. gimmi commented on Jan 25, 2022

    @gimmi

    Is it possible to have a pre release available for download?

  14. added
    🦄 feature request
    on May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🦄 feature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions