Skip to content

Commit ac3e74f

Browse files
feat: allow image links to use custom icons based on destination
1 parent 6d03af1 commit ac3e74f

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

doc/render-markdown.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*render-markdown.txt* For NVIM v0.11.2 Last change: 2025 June 10
1+
*render-markdown.txt* For NVIM v0.11.2 Last change: 2025 June 11
22

33
==============================================================================
44
Table of Contents *render-markdown-table-of-contents*

lua/render-markdown/health.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ local state = require('render-markdown.state')
55
local M = {}
66

77
---@private
8-
M.version = '8.5.0'
8+
M.version = '8.5.1'
99

1010
function M.check()
1111
M.start('version')

lua/render-markdown/render/inline/link.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ function Render:setup()
2727
autolink = true
2828
elseif self.node.type == 'image' then
2929
icon[1] = config.image
30+
local destination = self.node:child('link_destination')
31+
if destination then
32+
self.context.config:set_link_text(destination.text, icon)
33+
end
3034
elseif self.node.type == 'inline_link' then
3135
local destination = self.node:child('link_destination')
3236
if destination then

0 commit comments

Comments
 (0)