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

bullet list/enumerated with : in paragraph #20

Open
Carreau opened this issue Nov 6, 2021 · 7 comments
Open

bullet list/enumerated with : in paragraph #20

Carreau opened this issue Nov 6, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@Carreau
Copy link

Carreau commented Nov 6, 2021

Apologies, I know I've been opening many issues recently, and again I want to thank you for writing this.

It appears the sphinx/docutils parses this:

Bullet list:
    * stuff : other
    * stuff : other
    * stuff : other

As bullet list, but tree-sitter-rst is unhappy and return an error node.

It does the same with enumerated lists, and it is sensitive to space before/after the :

As found in the wild in

https://github.com/scipy/scipy/blob/9a657fb04b90c6efc4a8115ab2c1a360ea380f45/scipy/sparse/linalg/isolve/iterative.py#L452-L455
Rendered here
https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.gmres.html

Again I'm unsure how critical this is, and I just want to report difference with other rst parsers. It might be that the fix needs to be in scipy source.

On a related note I tried w/o the leading bullet points as well, and this errors as well, though it might invalid rst syntax, i'm unsure.

Not sure what:
    stuff : other
    stuff : other
    stuff : other
@stsewd
Copy link
Owner

stsewd commented Nov 6, 2021

Apologies, I know I've been opening many issues recently, and again I want to thank you for writing this.

Please keep them coming!

I think this is the same problem as #16, the parser gets confused with the :. I think I'll probably need to move the parsing of : to the external scanner, aka c code.

@stsewd stsewd added the bug Something isn't working label Nov 6, 2021
@stsewd
Copy link
Owner

stsewd commented Dec 25, 2021

So, I'm trying to fix this, and is being a little complicated, since definition lists don't have a character that indicates the start of the list (like a bullet in a normal list), but I'm experimenting with some solutions.

But, if this is blocking you, you can comment this line

optional($._classifiers),
, and both of your issues should be fixed, but of course, you would lose the parsing of the classifiers, and instead they will be part of the term node.

@Carreau
Copy link
Author

Carreau commented Dec 25, 2021

I'm not particularly blocked by this, I would actually be happy to try to update scipy.sparse.linalg.gmres to use a different syntax that is not ambiguous. I can try to convince the maintainers to do so at some points.

@Carreau
Copy link
Author

Carreau commented Dec 27, 2021

Not sure if same thing but:

set_state :
	Context manager that sets the backend state.
get_state : <-- error if trailing space here.
	Gets a state to be set by this context manager.

@stsewd
Copy link
Owner

stsewd commented Dec 28, 2021

yeah, it's the same problem.

@cpkio
Copy link

cpkio commented Feb 1, 2022

Another addition to the same problem I suppose:

test (27:00 minute video) *review* test

test *review* test

Italics in the first line will not be detected. From the playground:

document [0, 0] - [4, 0]
  paragraph [0, 0] - [0, 39]
  paragraph [2, 0] - [2, 18]
    emphasis [2, 5] - [2, 13]

@stsewd
Copy link
Owner

stsewd commented Dec 29, 2023

@cpkio looks like your example was fixed with #41. Added a regression test in 3ba9eb9.

The original problem reported in the issue still persists, sadly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants