From cc26cf0400286990d553bee993c9b113ca4cbc46 Mon Sep 17 00:00:00 2001 From: Yi Ming Date: Tue, 6 Aug 2024 21:25:31 +0800 Subject: fix(docs): do not treat indexes as `short_link` --- scripts/text_utils.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts/text_utils.lua') diff --git a/scripts/text_utils.lua b/scripts/text_utils.lua index 75b3bfedd5..3569f5a5af 100644 --- a/scripts/text_utils.lua +++ b/scripts/text_utils.lua @@ -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 -- cgit