mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 00:59:03 +01:00
Links are not automatically pasted as Markdown link if nothing is selected (#189338)
update automatic pasting
This commit is contained in:
@@ -148,11 +148,24 @@ suite('createEditAddingLinksForUriList', () => {
|
||||
};
|
||||
|
||||
test('Should evaluate pasteAsMarkdownLink as true for selected plain text', () => {
|
||||
const range = new vscode.Range(0, 5, 0, 5);
|
||||
const range = new vscode.Range(0, 0, 0, 12);
|
||||
const smartPaste = checkSmartPaste(skinnyDocument, range);
|
||||
assert.strictEqual(smartPaste.pasteAsMarkdownLink, true);
|
||||
});
|
||||
|
||||
test('Should evaluate pasteAsMarkdownLink as false for no selection', () => {
|
||||
const range = new vscode.Range(0, 0, 0, 0);
|
||||
const smartPaste = checkSmartPaste(skinnyDocument, range);
|
||||
assert.strictEqual(smartPaste.pasteAsMarkdownLink, false);
|
||||
});
|
||||
|
||||
test('Should evaluate pasteAsMarkdownLink as false for selected whitespace and new lines', () => {
|
||||
skinnyDocument.getText = function () { return ' \r\n\r\n'; };
|
||||
const range = new vscode.Range(0, 0, 0, 7);
|
||||
const smartPaste = checkSmartPaste(skinnyDocument, range);
|
||||
assert.strictEqual(smartPaste.pasteAsMarkdownLink, false);
|
||||
});
|
||||
|
||||
test('Should evaluate pasteAsMarkdownLink as false for pasting within a backtick code block', () => {
|
||||
skinnyDocument.getText = function () { return '```\r\n\r\n```'; };
|
||||
const range = new vscode.Range(0, 5, 0, 5);
|
||||
|
||||
Reference in New Issue
Block a user