Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow blank line between list items ? #29

Open
Carreau opened this issue Apr 2, 2022 · 2 comments
Open

Allow blank line between list items ? #29

Carreau opened this issue Apr 2, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@Carreau
Copy link

Carreau commented Apr 2, 2022

It looks like tree-sitter-rst is a bit greedy in deciding to construct a new Enumerated/Bullet list. I think allowing to add blank lines between items would be good.

1. first Enumerated list item

   * bullet
   * bullet
   * bullet
2. second Enumerated list item
   
   * actually a full bullet list
   
   * actually a full bullet list
   
   * actually a  full bullet list
   
3. Actually First item of a new enumerate list
   
   * actually a full bullet list
   
   * actually a full bullet list
   
   * actually a  full bullet list

I think that for my project I can locally fix it is two consecutive nodes are of the same list type, merge them.

as for other issues, I'm happy to take a shot at it, but I might need pointers.

@stsewd
Copy link
Owner

stsewd commented May 13, 2022

Sorry for the late reply, yeah, this is on my todos https://github.com/stsewd/tree-sitter-rst#todo, the main thing I had problems with was that lists are kind of a special block element, all other block elements are separated by a blank line, but lists can continue after a blank line, and they also can start a new list if the bullet is different, like

* one

* two

- three

Those are two lists! But I could try to solve the first problem at least, for the second I'll need to give each bullet its own node probably

@stsewd stsewd added the enhancement New feature or request label May 13, 2022
@Carreau
Copy link
Author

Carreau commented May 15, 2022

Ah sorry I missed the todo. And good point for the different bullet.

Currently I just have an extra pass, that combine successive identical lists, so that's fine.
When I find some time to learn tree-sitter, I can give a shot at fixing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants