From 2b450b66fee4906e746f6e04a6d07a72ff2faf64 Mon Sep 17 00:00:00 2001 From: grm Date: Sat, 12 Sep 2026 12:26:17 +0300 Subject: Insert images straight from the Markdown editor A shared editor partial adds an "Insert image" file picker plus paste and drag-and-drop on the textarea; a few lines of inline JS upload the file to the existing images endpoint (which now answers JSON when asked) and put the Markdown at the caret. Without JS the same file rides along with the form and is appended to the text on save, so nothing depends on scripting. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A --- internal/web/templates/partials/editor.html | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 internal/web/templates/partials/editor.html (limited to 'internal/web/templates/partials/editor.html') diff --git a/internal/web/templates/partials/editor.html b/internal/web/templates/partials/editor.html new file mode 100644 index 0000000..8e0acaf --- /dev/null +++ b/internal/web/templates/partials/editor.html @@ -0,0 +1,44 @@ +{{define "editor"}} +
+ + + …or paste / drop an image into the text. + +
+{{template "mdhelp"}} +{{end}} -- cgit v1.2.3