@@ -195,6 +195,10 @@ suite('createEditAddingLinksForUriList', () => {
195
195
assert . strictEqual (
196
196
await shouldInsertMarkdownLinkByDefault ( createNewMarkdownEngine ( ) , makeTestDoc ( '[ref]: ' ) , PasteUrlAsMarkdownLink . Smart , [ new vscode . Range ( 0 , 7 , 0 , 7 ) ] , noopToken ) ,
197
197
false ) ;
198
+
199
+ assert . strictEqual (
200
+ await shouldInsertMarkdownLinkByDefault ( createNewMarkdownEngine ( ) , makeTestDoc ( '[ref]: ' ) , PasteUrlAsMarkdownLink . Smart , [ new vscode . Range ( 0 , 0 , 0 , 0 ) ] , noopToken ) ,
201
+ false ) ;
198
202
} ) ;
199
203
200
204
test ( 'Smart should be disabled in html blocks' , async ( ) => {
@@ -235,11 +239,24 @@ suite('createEditAddingLinksForUriList', () => {
235
239
test ( 'Smart should be disabled in inline code' , async ( ) => {
236
240
assert . strictEqual (
237
241
await shouldInsertMarkdownLinkByDefault ( createNewMarkdownEngine ( ) , makeTestDoc ( '``' ) , PasteUrlAsMarkdownLink . Smart , [ new vscode . Range ( 0 , 1 , 0 , 1 ) ] , noopToken ) ,
238
- false ) ;
242
+ false ,
243
+ 'Should be disabled inside of inline code' ) ;
239
244
240
245
assert . strictEqual (
241
246
await shouldInsertMarkdownLinkByDefault ( createNewMarkdownEngine ( ) , makeTestDoc ( '``' ) , PasteUrlAsMarkdownLink . Smart , [ new vscode . Range ( 0 , 0 , 0 , 0 ) ] , noopToken ) ,
242
- false ) ;
247
+ true ,
248
+ 'Should be enabled when cursor is outside but next to inline code' ) ;
249
+
250
+ assert . strictEqual (
251
+ await shouldInsertMarkdownLinkByDefault ( createNewMarkdownEngine ( ) , makeTestDoc ( '`a`' ) , PasteUrlAsMarkdownLink . Smart , [ new vscode . Range ( 0 , 3 , 0 , 3 ) ] , noopToken ) ,
252
+ true ,
253
+ 'Should be enabled when cursor is outside but next to inline code' ) ;
254
+ } ) ;
255
+
256
+ test ( 'Smart should be enabled when pasting over inline code ' , async ( ) => {
257
+ assert . strictEqual (
258
+ await shouldInsertMarkdownLinkByDefault ( createNewMarkdownEngine ( ) , makeTestDoc ( '`xyz`' ) , PasteUrlAsMarkdownLink . Smart , [ new vscode . Range ( 0 , 0 , 0 , 5 ) ] , noopToken ) ,
259
+ true ) ;
243
260
} ) ;
244
261
245
262
test ( 'Smart should be disabled in inline math' , async ( ) => {
0 commit comments