Backport #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 #17057 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
		
							parent
							
								
									b661bbaed7
								
							
						
					
					
						commit
						653dff4e57
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -362,7 +362,7 @@ function initImagePaste(target) { | ||||||
|           const name = img.name.substr(0, img.name.lastIndexOf('.')); |           const name = img.name.substr(0, img.name.lastIndexOf('.')); | ||||||
|           insertAtCursor(textarea, `![${name}]()`); |           insertAtCursor(textarea, `![${name}]()`); | ||||||
|           const data = await uploadFile(img, uploadUrl); |           const data = await uploadFile(img, uploadUrl); | ||||||
|           replaceAndKeepCursor(textarea, `![${name}]()`, ``); |           replaceAndKeepCursor(textarea, `![${name}]()`, ``); | ||||||
|           const input = $(`<input id="${data.uuid}" name="files" type="hidden">`).val(data.uuid); |           const input = $(`<input id="${data.uuid}" name="files" type="hidden">`).val(data.uuid); | ||||||
|           dropzoneFiles.appendChild(input[0]); |           dropzoneFiles.appendChild(input[0]); | ||||||
|         } |         } | ||||||
|  | @ -378,7 +378,7 @@ function initSimpleMDEImagePaste(simplemde, dropzone, files) { | ||||||
|       const name = img.name.substr(0, img.name.lastIndexOf('.')); |       const name = img.name.substr(0, img.name.lastIndexOf('.')); | ||||||
|       const data = await uploadFile(img, uploadUrl); |       const data = await uploadFile(img, uploadUrl); | ||||||
|       const pos = simplemde.codemirror.getCursor(); |       const pos = simplemde.codemirror.getCursor(); | ||||||
|       simplemde.codemirror.replaceRange(``, pos); |       simplemde.codemirror.replaceRange(``, pos); | ||||||
|       const input = $(`<input id="${data.uuid}" name="files" type="hidden">`).val(data.uuid); |       const input = $(`<input id="${data.uuid}" name="files" type="hidden">`).val(data.uuid); | ||||||
|       files.append(input); |       files.append(input); | ||||||
|     } |     } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue