@@ -5,6 +5,8 @@ local api = vim.api
55
66describe (' highlighter' , function ()
77 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+
810 local get_extmarks = function (content )
911 --- @diagnostic disable-next-line : inject-field
1012 config .ts_hl_enabled = true
@@ -33,6 +35,9 @@ describe('highlighter', function()
3335 if opts .spell ~= nil then
3436 assert .are .same (opts .spell , details .spell , ' spell is not matching' )
3537 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
3641 end
3742
3843 after_each (function ()
@@ -209,7 +214,10 @@ describe('highlighter', function()
209214 ' I have [[https://google.com]] link' ,
210215 })
211216 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+ )
213221 assert_extmark (extmarks [2 ], { line = 0 , start_col = 7 , end_col = 9 , conceal = ' ' })
214222 assert_extmark (extmarks [3 ], { line = 0 , start_col = 9 , end_col = 27 , spell = false })
215223 assert_extmark (extmarks [4 ], { line = 0 , start_col = 27 , end_col = 29 , conceal = ' ' })
@@ -220,7 +228,10 @@ describe('highlighter', function()
220228 ' I have [[https://google.com][google]] link' ,
221229 })
222230 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+ )
224235 assert_extmark (extmarks [2 ], { line = 0 , start_col = 7 , end_col = 29 , conceal = ' ' })
225236 assert_extmark (extmarks [3 ], { line = 0 , start_col = 9 , end_col = 27 , spell = false })
226237 assert_extmark (extmarks [4 ], { line = 0 , start_col = 35 , end_col = 37 , conceal = ' ' })
@@ -231,7 +242,10 @@ describe('highlighter', function()
231242 ' I have [[https://google.com][google I am *not bold*]] link' ,
232243 })
233244 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+ )
235249 assert_extmark (extmarks [2 ], { line = 0 , start_col = 7 , end_col = 29 , conceal = ' ' })
236250 assert_extmark (extmarks [3 ], { line = 0 , start_col = 9 , end_col = 27 , spell = false })
237251 assert_extmark (extmarks [4 ], { line = 0 , start_col = 51 , end_col = 53 , conceal = ' ' })
0 commit comments