Skip to content

Commit f5917d2

Browse files
Only render bullet point in lists that use +, -, or *. Essentially ignore ordered lists.
1 parent 70f8f4f commit f5917d2

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Diff for: README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ require('render-markdown').setup({
5555
5656
(fenced_code_block) @code
5757
58-
(list_item) @item
58+
(list_marker_plus) @list_marker
59+
(list_marker_minus) @list_marker
60+
(list_marker_star) @list_marker
5961
6062
(pipe_table_header) @table_head
6163
(pipe_table_delimiter_row) @table_delim

Diff for: lua/render-markdown/init.lua

+5-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ function M.setup(opts)
4141
4242
(fenced_code_block) @code
4343
44-
(list_item) @item
44+
(list_marker_plus) @list_marker
45+
(list_marker_minus) @list_marker
46+
(list_marker_star) @list_marker
4547
4648
(pipe_table_header) @table_head
4749
(pipe_table_delimiter_row) @table_delim
@@ -168,8 +170,8 @@ M.handle_markdown = function(tree)
168170
hl_group = highlights.code,
169171
hl_eol = true,
170172
})
171-
elseif capture == 'item' then
172-
-- List items from tree-sitter should have leading spaces removed, however there are known
173+
elseif capture == 'list_marker' then
174+
-- List markers from tree-sitter should have leading spaces removed, however there are known
173175
-- edge cases in the parser: https://github.com/tree-sitter-grammars/tree-sitter-markdown/issues/127
174176
-- As a result we handle leading spaces here, can remove if this gets fixed upstream
175177
local _, leading_spaces = value:find('^%s*')

0 commit comments

Comments
 (0)