Fixed markdown regular expression (#189423)

* fixed md regex

* update shared.ts
This commit is contained in:
Meghan Kulkarni
2023-08-01 14:32:33 -07:00
committed by GitHub
parent ca5cfcca06
commit 0e15feeb95
2 changed files with 10 additions and 12 deletions

View File

@@ -170,6 +170,12 @@ suite('createEditAddingLinksForUriList', () => {
assert.strictEqual(pasteAsMarkdownLink, false);
});
test('Should evaluate pasteAsMarkdownLink as true for a link pasted in square brackets', () => {
skinnyDocument.getText = function () { return '[abc]'; };
const pasteAsMarkdownLink = checkSmartPaste(skinnyDocument, new vscode.Range(0, 1, 0, 4), new vscode.Range(0, 1, 0, 4));
assert.strictEqual(pasteAsMarkdownLink, true);
});
test('Should evaluate pasteAsMarkdownLink as false for no selection', () => {
const pasteAsMarkdownLink = checkSmartPaste(skinnyDocument, new vscode.Range(0, 0, 0, 0), new vscode.Range(0, 0, 0, 0));
assert.strictEqual(pasteAsMarkdownLink, false);