Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relative image links turn to absolute links #2652

Closed
Hoffenbar opened this issue Oct 15, 2021 · 1 comment · Fixed by #2676
Closed

relative image links turn to absolute links #2652

Hoffenbar opened this issue Oct 15, 2021 · 1 comment · Fixed by #2676

Comments

@Hoffenbar
Copy link

Hoffenbar commented Oct 15, 2021

Description

I specified a relative path to images, like '../_resources', in the configuration dialog, and the pasted images indeed are stored there (sometimes...). But however, within the .md-file the links are stored as absolute paths in windows notation. This prevents the document from being copied elsewhere even together with it's _resource folder - the absolute paths will not work in arbitrary locations. The imagepaths should alway be codes relative to the document path I think. Additionally the term relative should not be mean relative to the current dir (whatever this is) or something else, but relative to the current document (if one is opened), or else it makes no sense! See some screenshots below.

Steps to reproduce

  1. [First step]
  2. [Second step]
  3. [and so on...]

Expected behavior:

Actual behavior:

Link to an example: [optional]

Some Screenshots:

image
Document isn't saved yet, so default for storing attached files take place:
image
This settings are active:
image
Now saving the document and paste another image in:
image

If the document is saved somewhere, then the result is right but in absolute format:

image

Versions

  • Mark Text: latest
  • Operating system: Windows 10
@jgato
Copy link

jgato commented Oct 20, 2021

the same here. Once I paste the image, which is placed correctly in the relative path, I have to manually edit the route to make it relative.

kiyoka added a commit to kiyoka/marktext that referenced this issue Nov 23, 2021
Fixed a problem with image links being absolute paths.
Fix for issue 2652.
marktext#2652
kiyoka added a commit to kiyoka/marktext that referenced this issue Dec 6, 2021
marktext#2652
Fixed the call position of ensureDirSync().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants