@@ -23,6 +23,77 @@ asciidoc.document_attribute = function (buffer, item)
2323 });
2424end
2525
26+ --- @param buffer integer
27+ --- @param item markview.parsed.asciidoc.images
28+ asciidoc .image = function (buffer , item )
29+ --- @type markview.config.asciidoc.images ?
30+ local main_config = spec .get ({ " asciidoc" , " images" }, { fallback = nil });
31+ local range = item .range ;
32+
33+ if not main_config then
34+ return ;
35+ end
36+
37+ --- @type markview.config.asciidoc.images.opts ?
38+ local config = utils .match (
39+ main_config ,
40+ item .destination ,
41+ {
42+ eval_args = { buffer , item }
43+ }
44+ );
45+
46+ if config == nil then
47+ return ;
48+ end
49+
50+ utils .set_extmark (buffer , asciidoc .ns , range .row_start , range .col_start , {
51+ end_col = range .destination [2 ],
52+ conceal = " " ,
53+
54+ virt_text_pos = " inline" ,
55+ virt_text = {
56+ { config .corner_left or " " , utils .set_hl (config .corner_left_hl or config .hl ) },
57+ { config .padding_left or " " , utils .set_hl (config .padding_left_hl or config .hl ) },
58+ { config .icon or " " , utils .set_hl (config .icon_hl or config .hl ) }
59+ },
60+
61+ hl_mode = " combine"
62+ });
63+
64+ if config .text then
65+ utils .set_extmark (buffer , asciidoc .ns , range .destination [1 ], range .destination [2 ], {
66+ end_col = range .destination [4 ], end_row = range .destination [3 ],
67+
68+ virt_text = {
69+ { config .text or " " , utils .set_hl (config .text_hl or config .hl ) }
70+ },
71+
72+ hl_mode = " combine"
73+ });
74+ else
75+ utils .set_extmark (buffer , asciidoc .ns , range .destination [1 ], range .destination [2 ], {
76+ end_col = range .destination [4 ], end_row = range .destination [3 ],
77+
78+ hl_group = utils .set_hl (config .hl ),
79+ hl_mode = " combine"
80+ });
81+ end
82+
83+ utils .set_extmark (buffer , asciidoc .ns , range .row_end , range .destination [4 ], {
84+ end_col = range .col_end ,
85+ conceal = " " ,
86+
87+ virt_text_pos = " inline" ,
88+ virt_text = {
89+ { config .corner_right or " " , utils .set_hl (config .corner_right_hl or config .hl ) },
90+ { config .padding_right or " " , utils .set_hl (config .padding_right_hl or config .hl ) }
91+ },
92+
93+ hl_mode = " combine"
94+ });
95+ end
96+
2697--- @param buffer integer
2798--- @param item markview.parsed.asciidoc.document_titles
2899asciidoc .document_title = function (buffer , item )
0 commit comments