Serve upload files directly from nginx

This commit is contained in:
klmp200 committed 2025-04-09 20:55:24 +02:00
1 parent 91b30e7550
commit 67bc49fb21
10 files changed
+65 -52

No files matched your search

@@ -26,13 +26,14 @@ const loadEasyMde = (textarea: HTMLTextAreaElement) => {
return;
}
onSuccess(response.data.href);
// Workaround function to add ! and image name to uploaded image
// Without this, you get [](url) instead of ![name](url)
// Workaround function to add an image name to uploaded image
// Without this, you get ![](url) instead of ![name](url)
let cursor = easymde.codemirror.getCursor();
easymde.codemirror.setSelection({ line: cursor.line, ch: cursor.ch - 1 });
easymde.codemirror.replaceSelection("!");
easymde.codemirror.setSelection({ line: cursor.line, ch: cursor.ch + 1 });
easymde.codemirror.setSelection({
line: cursor.line,
ch: cursor.ch - response.data.href.length - 3,
});
easymde.codemirror.replaceSelection(response.data.name);
// Move cursor at the end of the url and add a new line