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
This commit is contained in:
l0ng-ai
2026-10-31 08:48:10 +08:00
committed by GitHub
parent f592ff5b05
commit df6ed5ccba
18 changed files with 498 additions and 2 deletions
+6
View File
@@ -19,6 +19,12 @@ pub fn fs_create_file(window: Window, state: State<'_, AppState>, path: PathBuf)
fs::create_file(&state.host, window.label(), path)
}
#[tauri::command]
#[specta::specta]
pub async fn fs_create_file_bytes(state: State<'_, AppState>, path: PathBuf, data: Vec<u8>) -> IdeResult<()> {
fs::create_file_bytes(&state.host, path, data).await
}
#[tauri::command]
#[specta::specta]
pub fn fs_create_dir(path: PathBuf) -> IdeResult<()> {
+1
View File
@@ -126,6 +126,7 @@ pub fn builder() -> tauri_specta::Builder<tauri::Wry> {
bytes::fs_read_range,
bytes::fs_read_image,
fs::fs_create_file,
fs::fs_create_file_bytes,
fs::fs_create_dir,
fs::fs_rename,
fs::fs_set_writable,