You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Absolute path for pasted images although local folder is configured #2510
🪲 pri/majorBugs will affect your normal use of Mark Text, causing you unwilling or unable to continue using MT🐛 bugSomething isn't working🔭 area/editor
Thank you for this detailed report. The behavior you described — pasted images always getting an absolute path even when saving to a relative folder — has since been addressed.
A "Prefer relative directory" toggle was added to Preferences → Image (under the Folder Setting section). When enabled, MarkText resolves the saved path relative to the current file and writes a portable relative reference (e.g. images/screenshot.png) into the markdown instead of an absolute path. The logic for binary clipboard pastes specifically is in the imageAction handler (editor.vue) and routes through moveImageToFolder with isRelative=true when that preference is on. A follow-up fix in #4492 also closed a gap where inserting via a local file path string skipped the relative conversion.
To use relative paths today: open Preferences → Image, ensure "Default behavior" is set to "Move image to folder", then enable the "Prefer relative directory" checkbox and configure the relative folder name (default: assets). The file must be saved to disk for the relative reference to be computed.
Closing as implemented. Please reopen if you find a remaining case where the preference is on but an absolute path is still written.
🪲 pri/majorBugs will affect your normal use of Mark Text, causing you unwilling or unable to continue using MT🐛 bugSomething isn't working🔭 area/editor
Activity
northword commentedon Feb 23, 2021
related to #2105.
not only for pasted images, image from local file also is absolute path, i also need inserting to relative path.
Jocs commentedon Jun 23, 2026
Thank you for this detailed report. The behavior you described — pasted images always getting an absolute path even when saving to a relative folder — has since been addressed.
A "Prefer relative directory" toggle was added to Preferences → Image (under the Folder Setting section). When enabled, MarkText resolves the saved path relative to the current file and writes a portable relative reference (e.g.
images/screenshot.png) into the markdown instead of an absolute path. The logic for binary clipboard pastes specifically is in theimageActionhandler (editor.vue) and routes throughmoveImageToFolderwithisRelative=truewhen that preference is on. A follow-up fix in #4492 also closed a gap where inserting via a local file path string skipped the relative conversion.To use relative paths today: open Preferences → Image, ensure "Default behavior" is set to "Move image to folder", then enable the "Prefer relative directory" checkbox and configure the relative folder name (default:
assets). The file must be saved to disk for the relative reference to be computed.Closing as implemented. Please reopen if you find a remaining case where the preference is on but an absolute path is still written.