Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Converting selected text to MD link when pasting a URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Sinharitik589 committed Apr 8, 2022
1 parent a4c3b05 commit 7750b6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/editor/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export function formatRangeAsLink(range: Range, text?: string) {
replaceRangeAndAutoAdjustCaret(range, newParts, true, prefixLength, suffixLength);
} else {
// We set offset to -1 here so that the caret lands between the brackets
replaceRangeAndMoveCaret(range, [partCreator.plain("[" + range.text + "]" + "(" + (text ?? "") + ")")],-1);
replaceRangeAndMoveCaret(range, [partCreator.plain("[" + range.text + "]" + "(" + (text ?? "") + ")")], -1);
}
}

Expand Down

0 comments on commit 7750b6a

Please sign in to comment.