1- local async_tests = require ( ' plenary.async.tests ' )
1+ --- @module ' luassert '
22local util = require (' tests.util' )
33
4+ --- @param namespace integer
5+ --- @param root TSNode
6+ --- @param buf integer
47local function render_conceal_escape (namespace , root , buf )
58 local query = vim .treesitter .query .parse (' markdown_inline' , ' (backslash_escape) @escape' )
69 for _ , node in query :iter_captures (root , buf ) do
@@ -13,12 +16,16 @@ local function render_conceal_escape(namespace, root, buf)
1316 end
1417end
1518
19+ --- @param root TSNode
20+ --- @param buf integer
21+ --- @return render.md.Mark[]
1622local function parse_conceal_escape (root , buf )
17- local query = vim .treesitter .query .parse (' markdown_inline' , ' (backslash_escape) @escape' )
1823 local marks = {}
24+ local query = vim .treesitter .query .parse (' markdown_inline' , ' (backslash_escape) @escape' )
1925 for _ , node in query :iter_captures (root , buf ) do
2026 local start_row , start_col , end_row , _ = node :range ()
21- table.insert (marks , {
27+ --- @type render.md.Mark
28+ local mark = {
2229 conceal = true ,
2330 start_row = start_row ,
2431 start_col = start_col ,
@@ -27,7 +34,8 @@ local function parse_conceal_escape(root, buf)
2734 end_col = start_col + 1 ,
2835 conceal = ' ' ,
2936 },
30- })
37+ }
38+ table.insert (marks , mark )
3139 end
3240 return marks
3341end
3644--- @param col integer
3745--- @return render.md.MarkInfo
3846local function backslash (row , col )
47+ --- @type render.md.MarkInfo
3948 return {
4049 row = { row , row },
4150 col = { col , col + 1 },
4251 conceal = ' ' ,
4352 }
4453end
4554
46- async_tests . describe (' custom_handler.md' , function ()
47- async_tests . it (' default' , function ()
55+ describe (' custom_handler.md' , function ()
56+ it (' default' , function ()
4857 util .setup (' tests/data/custom_handler.md' )
4958
5059 local expected = {}
@@ -57,7 +66,7 @@ async_tests.describe('custom_handler.md', function()
5766 util .marks_are_equal (expected , actual )
5867 end )
5968
60- async_tests . it (' custom override deprecated render' , function ()
69+ it (' custom override deprecated render' , function ()
6170 util .setup (' tests/data/custom_handler.md' , {
6271 custom_handlers = {
6372 --- @diagnostic disable-next-line : missing-fields
@@ -79,7 +88,7 @@ async_tests.describe('custom_handler.md', function()
7988 util .marks_are_equal (expected , actual )
8089 end )
8190
82- async_tests . it (' custom override parse' , function ()
91+ it (' custom override parse' , function ()
8392 util .setup (' tests/data/custom_handler.md' , {
8493 custom_handlers = {
8594 markdown_inline = {
@@ -100,7 +109,7 @@ async_tests.describe('custom_handler.md', function()
100109 util .marks_are_equal (expected , actual )
101110 end )
102111
103- async_tests . it (' custom extends' , function ()
112+ it (' custom extends' , function ()
104113 util .setup (' tests/data/custom_handler.md' , {
105114 custom_handlers = {
106115 markdown_inline = {
0 commit comments