fix(docs): do not treat indexes as short_link

This commit is contained in:
Yi Ming 2024-08-06 21:25:31 +08:00 committed by Christian Clason
parent 93347a67bf
commit cc26cf0400

View File

@ -207,6 +207,8 @@ local function render_md(node, start_indent, indent, text_width, level, is_list)
elseif ntype == 'shortcut_link' then
if node[1].text:find('^<.*>$') then
parts[#parts + 1] = node[1].text
elseif node[1].text:find('^%d+$') then
vim.list_extend(parts, { '[', node[1].text, ']' })
else
vim.list_extend(parts, { '|', node[1].text, '|' })
end