feat(editor): paste and drop images into Markdown files (#489)

Pasting or dropping an image into a Markdown editor saves it beside the document in `assets/` and inserts a URL-encoded relative link as one undo step, in local and remote projects. Existing names get numbered suffixes; the folder and clipboard name pattern are in Settings › Editor › General. Non-Markdown editors, text paste and other dropped files keep their behavior.

Fixes #308
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-10-31 08:48:10 +08:00
1 джерело f592ff5b05
коміт df6ed5ccba
18 files changed
+498 -2

No files matched your search

+3
Переглянути файл
@@ -151,6 +151,7 @@ export const commands = {
* `charset` (writes the BOM for `utf-8-bom` / UTF-16).
*/
fsCreateFile: (path: string) => typedError<null, IdeError>(__TAURI_INVOKE("fs_create_file", { path })),
fsCreateFileBytes: (path: string, data: number[]) => typedError<null, IdeError>(__TAURI_INVOKE("fs_create_file_bytes", { path, data })),
fsCreateDir: (path: string) => typedError<null, IdeError>(__TAURI_INVOKE("fs_create_dir", { path })),
fsRename: (from: string, to: string) => typedError<null, IdeError>(__TAURI_INVOKE("fs_rename", { from, to })),
/**
@@ -2700,6 +2701,8 @@ export type EditorConfigProps = {
export type EditorGeneralSettings = {
/** Change font size with ⌘ + mouse wheel. */
wheelZoom?: boolean,
markdownImageFolder?: string,
markdownImageNamePattern?: string,
/** Drag-and-drop of selected text inside the editor. */
dragAndDrop?: boolean,
/** When the caret moves out of view: `minimize` scrolling | `center` the caret line. */