Skip to content

Commit 696a49c

Browse files
committed
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 bd613c7 commit 696a49c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

web_src/js/features/comp/ImagePaste.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function initCompImagePaste($target) {
6767
const name = img.name.substr(0, img.name.lastIndexOf('.'));
6868
insertAtCursor(textarea, `![${name}]()`);
6969
const data = await uploadFile(img, uploadUrl);
70-
replaceAndKeepCursor(textarea, `![${name}]()`, `![${name}](${appSubUrl}/attachments/${data.uuid})`);
70+
replaceAndKeepCursor(textarea, `![${name}]()`, `![${name}](/attachments/${data.uuid})`);
7171
const input = $(`<input id="${data.uuid}" name="files" type="hidden">`).val(data.uuid);
7272
dropzoneFiles.appendChild(input[0]);
7373
}
@@ -83,7 +83,7 @@ export function initSimpleMDEImagePaste(simplemde, dropzone, files) {
8383
const name = img.name.substr(0, img.name.lastIndexOf('.'));
8484
const data = await uploadFile(img, uploadUrl);
8585
const pos = simplemde.codemirror.getCursor();
86-
simplemde.codemirror.replaceRange(`![${name}](${appSubUrl}/attachments/${data.uuid})`, pos);
86+
simplemde.codemirror.replaceRange(`![${name}](/attachments/${data.uuid})`, pos);
8787
const input = $(`<input id="${data.uuid}" name="files" type="hidden">`).val(data.uuid);
8888
files.append(input);
8989
}

0 commit comments

Comments
 (0)