Skip to content

Commit b167f7e

Browse files
committed
Remove appSubUrl from pasted images (go-gitea#17572)
Backport go-gitea#17572 * Remove appSubUrl from pasted images Since we fixed the url base for the links in repositories we no longer need to add the appsuburl to pasted image links. Fix go-gitea#17057 Signed-off-by: Andrew Thornton <[email protected]>
1 parent b661bba commit b167f7e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

web_src/js/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ function initImagePaste(target) {
362362
const name = img.name.substr(0, img.name.lastIndexOf('.'));
363363
insertAtCursor(textarea, `![${name}]()`);
364364
const data = await uploadFile(img, uploadUrl);
365-
replaceAndKeepCursor(textarea, `![${name}]()`, `![${name}](${AppSubUrl}/attachments/${data.uuid})`);
365+
replaceAndKeepCursor(textarea, `![${name}]()`, `![${name}](/attachments/${data.uuid})`);
366366
const input = $(`<input id="${data.uuid}" name="files" type="hidden">`).val(data.uuid);
367367
dropzoneFiles.appendChild(input[0]);
368368
}
@@ -378,7 +378,7 @@ function initSimpleMDEImagePaste(simplemde, dropzone, files) {
378378
const name = img.name.substr(0, img.name.lastIndexOf('.'));
379379
const data = await uploadFile(img, uploadUrl);
380380
const pos = simplemde.codemirror.getCursor();
381-
simplemde.codemirror.replaceRange(`![${name}](${AppSubUrl}/attachments/${data.uuid})`, pos);
381+
simplemde.codemirror.replaceRange(`![${name}](/attachments/${data.uuid})`, pos);
382382
const input = $(`<input id="${data.uuid}" name="files" type="hidden">`).val(data.uuid);
383383
files.append(input);
384384
}

0 commit comments

Comments
 (0)