Skip to content

Commit 92e1963

Browse files
fix: add nil check on current line
1 parent a525a61 commit 92e1963

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lua/render-markdown/handler/markdown_inline.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ function Handler:shortcut(info)
7474
return
7575
end
7676

77-
if info:line('on'):find('[' .. info.text .. ']', 1, true) ~= nil then
77+
local line = info:line('on')
78+
if line ~= nil and line:find('[' .. info.text .. ']', 1, true) ~= nil then
7879
self:wiki_link(info)
7980
return
8081
end

lua/render-markdown/node_info.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ function NodeInfo:for_each_child(callback)
126126
end
127127

128128
---@param position 'above'|'below'|'on'
129-
---@return string
129+
---@return string?
130130
function NodeInfo:line(position)
131131
local start_row = nil
132132
if position == 'above' then

0 commit comments

Comments
 (0)