mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
Serve upload files directly from nginx
This commit is contained in:
@ -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 
|
||||
// Workaround function to add an image name to uploaded image
|
||||
// Without this, you get  instead of 
|
||||
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
|
||||
|
Reference in New Issue
Block a user