File tree 5 files changed +15
-9
lines changed
5 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ local state = require('render-markdown.state')
5
5
local M = {}
6
6
7
7
--- @private
8
- M .version = ' 8.0.17 '
8
+ M .version = ' 8.0.18 '
9
9
10
10
function M .check ()
11
11
M .start (' version' )
Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ local M = {}
15
15
--- @field public extends ? boolean
16
16
--- @field public parse fun (ctx : render.md.HandlerContext ): render.md.Mark[]
17
17
18
+ --- @class render.md.Text
19
+ --- @field [ 1] string text
20
+ --- @field [ 2] string | string[] highlights
21
+
18
22
--- @class (exact ) render.md.CallbackContext
19
23
--- @field public buf integer
20
24
@@ -88,7 +92,7 @@ local M = {}
88
92
89
93
--- @class (exact ) render.md.UserWikiLink
90
94
--- @field public icon ? string
91
- --- @field public body ? fun ( ctx : render.md.LinkContext ): string ?
95
+ --- @field public body ? fun ( ctx : render.md.LinkContext ): render.md.Text | string ?
92
96
--- @field public highlight ? string
93
97
94
98
--- @class (exact ) render.md.UserFootnote
Original file line number Diff line number Diff line change @@ -2,11 +2,7 @@ local Iter = require('render-markdown.lib.iter')
2
2
local Str = require (' render-markdown.lib.str' )
3
3
local colors = require (' render-markdown.colors' )
4
4
5
- --- @class render.md.line.Text
6
- --- @field [ 1] string text
7
- --- @field [ 2] string | string[] highlights
8
-
9
- --- @alias render.md.Line render.md.line.Text[]
5
+ --- @alias render.md.Line render.md.Text[]
10
6
11
7
--- @class render.md.Renderer
12
8
--- @field protected marks render.md.Marks
Original file line number Diff line number Diff line change @@ -127,9 +127,15 @@ function Render:wiki_link()
127
127
self :hide (ctx .start_col + 2 , # ctx .destination + 1 )
128
128
end
129
129
else
130
+ local line = {}
131
+ if type (body ) == ' string' then
132
+ table.insert (line , { icon .. body , highlight })
133
+ else
134
+ table.insert (line , { icon .. body [1 ], body [2 ] })
135
+ end
130
136
-- Inline icon & body, hide original text
131
137
self .marks :add_over (' link' , self .node , {
132
- virt_text = { { icon .. body , highlight } } ,
138
+ virt_text = line ,
133
139
virt_text_pos = ' inline' ,
134
140
conceal = ' ' ,
135
141
}, { 0 , 1 , 0 , - 1 })
Original file line number Diff line number Diff line change 54
54
55
55
--- @class (exact ) render.md.WikiLink
56
56
--- @field public icon string
57
- --- @field public body fun (ctx : render.md.LinkContext ): string ?
57
+ --- @field public body fun (ctx : render.md.LinkContext ): render.md.Text | string ?
58
58
--- @field public highlight string
59
59
60
60
--- @class (exact ) render.md.Footnote
You can’t perform that action at this time.
0 commit comments