Skip to content

Commit e9e3109

Browse files
committed
check shift down early
1 parent 565a720 commit e9e3109

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

web_src/js/features/comp/Paste.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,11 @@ async function handleClipboardImages(editor, dropzone, images, e) {
122122

123123
function handleClipboardText(textarea, text, e) {
124124
// when pasting links over selected text, turn it into [text](link)
125-
const {value, selectionStart, selectionEnd} = textarea;
125+
const {value, selectionStart, selectionEnd, _giteaShiftDown} = textarea;
126+
if (_giteaShiftDown) return;
126127
const selectedText = value.substring(selectionStart, selectionEnd);
127128
const trimmedText = text.trim();
128-
if (selectedText && isUrl(trimmedText) && !textarea._giteaShiftDown) {
129+
if (selectedText && isUrl(trimmedText)) {
129130
e.stopPropagation();
130131
e.preventDefault();
131132
replaceTextareaSelection(textarea, `[${selectedText}](${trimmedText})`);

0 commit comments

Comments
 (0)