tree-sitter-grammars / tree-sitter-markdown

Markdown grammar for tree-sitter
MIT License
374 stars 45 forks source link

Nested list item with 4 indents is concealed unexpectedly #127

Open bharam opened 7 months ago

bharam commented 7 months ago

Describe the bug First of all, thanks for working on this amazing parser!

After the recent update, the list_marker of the first nested list item with 4 spaces is concealed to nothing (``) while the following nested list items are concealed as expected. Please refer to below example.

Code example

- a list item with 4 spaces
    - first nested list item  <-- the `list_marker_minus` is concealed to blank
    - second nested list item <-- conceal works fine
    - third & more list items <-- conceal works fine

- a list item with 2 spaces
  - first nested list item <-- works fine
  - more items             <-- works fine

Expected behavior List item marker (-,+,*) should be concealed regardless of the tab size (2 or 4)

ribru17 commented 7 months ago

Apologies, this is an issue with nvim-treesitter, see this issue

bharam commented 7 months ago

Ah-ha! Didn't notice there was an existing issue. Thank you! :)

clason commented 7 months ago

That commit has been reverted; nevertheless, the original cause is due to the parser capturing inconsistent (item number dependent) whitespace around the marker. If this can be fixed, we can re-enable those conceals. (If not, this issue can be closed.) @MDeiml

MDeiml commented 7 months ago

So the first list item captures more whitespace (before the marker) than the following ones? Gonna check that out when I have time.

clason commented 7 months ago

The second does; see the the screenshot from the linked issue: image