mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 16:49:06 +01:00
Links are not automatically pasted as Markdown link if nothing is selected (#189338)
update automatic pasting
This commit is contained in:
@@ -151,6 +151,9 @@ export async function createEditAddingLinksForUriList(
|
||||
|
||||
export function checkSmartPaste(document: SkinnyTextDocument, selectedRange: vscode.Range): SmartPaste {
|
||||
const SmartPaste: SmartPaste = { pasteAsMarkdownLink: true, updateTitle: false };
|
||||
if (selectedRange.isEmpty || /^[\s\n]*$/.test(document.getText(selectedRange))) {
|
||||
return { pasteAsMarkdownLink: false, updateTitle: false };
|
||||
}
|
||||
for (const regex of smartPasteRegexes) {
|
||||
const matches = [...document.getText().matchAll(regex.regex)];
|
||||
for (const match of matches) {
|
||||
|
||||
Reference in New Issue
Block a user