@@ -5,6 +5,8 @@ local api = vim.api
5
5
6
6
describe (' highlighter' , function ()
7
7
local ns_id = api .nvim_create_namespace (' org_custom_highlighter' )
8
+ local has_extmarks_url_support = vim .fn .has (' nvim-0.10.2' ) == 1
9
+
8
10
local get_extmarks = function (content )
9
11
--- @diagnostic disable-next-line : inject-field
10
12
config .ts_hl_enabled = true
@@ -33,6 +35,9 @@ describe('highlighter', function()
33
35
if opts .spell ~= nil then
34
36
assert .are .same (opts .spell , details .spell , ' spell is not matching' )
35
37
end
38
+ if has_extmarks_url_support and opts .url ~= nil then
39
+ assert .are .same (opts .url , details .url , ' url is not matching' )
40
+ end
36
41
end
37
42
38
43
after_each (function ()
@@ -209,7 +214,10 @@ describe('highlighter', function()
209
214
' I have [[https://google.com]] link' ,
210
215
})
211
216
assert .are .same (4 , # extmarks )
212
- assert_extmark (extmarks [1 ], { line = 0 , start_col = 7 , end_col = 29 , hl_group = ' @org.hyperlink' })
217
+ assert_extmark (
218
+ extmarks [1 ],
219
+ { line = 0 , start_col = 7 , end_col = 29 , hl_group = ' @org.hyperlink' , url = ' https://google.com' }
220
+ )
213
221
assert_extmark (extmarks [2 ], { line = 0 , start_col = 7 , end_col = 9 , conceal = ' ' })
214
222
assert_extmark (extmarks [3 ], { line = 0 , start_col = 9 , end_col = 27 , spell = false })
215
223
assert_extmark (extmarks [4 ], { line = 0 , start_col = 27 , end_col = 29 , conceal = ' ' })
@@ -220,7 +228,10 @@ describe('highlighter', function()
220
228
' I have [[https://google.com][google]] link' ,
221
229
})
222
230
assert .are .same (4 , # extmarks )
223
- assert_extmark (extmarks [1 ], { line = 0 , start_col = 7 , end_col = 37 , hl_group = ' @org.hyperlink' })
231
+ assert_extmark (
232
+ extmarks [1 ],
233
+ { line = 0 , start_col = 7 , end_col = 37 , hl_group = ' @org.hyperlink' , url = ' https://google.com' }
234
+ )
224
235
assert_extmark (extmarks [2 ], { line = 0 , start_col = 7 , end_col = 29 , conceal = ' ' })
225
236
assert_extmark (extmarks [3 ], { line = 0 , start_col = 9 , end_col = 27 , spell = false })
226
237
assert_extmark (extmarks [4 ], { line = 0 , start_col = 35 , end_col = 37 , conceal = ' ' })
@@ -231,7 +242,10 @@ describe('highlighter', function()
231
242
' I have [[https://google.com][google I am *not bold*]] link' ,
232
243
})
233
244
assert .are .same (4 , # extmarks )
234
- assert_extmark (extmarks [1 ], { line = 0 , start_col = 7 , end_col = 53 , hl_group = ' @org.hyperlink' })
245
+ assert_extmark (
246
+ extmarks [1 ],
247
+ { line = 0 , start_col = 7 , end_col = 53 , hl_group = ' @org.hyperlink' , url = ' https://google.com' }
248
+ )
235
249
assert_extmark (extmarks [2 ], { line = 0 , start_col = 7 , end_col = 29 , conceal = ' ' })
236
250
assert_extmark (extmarks [3 ], { line = 0 , start_col = 9 , end_col = 27 , spell = false })
237
251
assert_extmark (extmarks [4 ], { line = 0 , start_col = 51 , end_col = 53 , conceal = ' ' })
0 commit comments