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

Literal block parsed as section title if :: start at a new line #27

Open
Carreau opened this issue Feb 11, 2022 · 1 comment
Open

Literal block parsed as section title if :: start at a new line #27

Carreau opened this issue Feb 11, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@Carreau
Copy link

Carreau commented Feb 11, 2022

Hello again an apologies as usual for my weirds use case.
Note again that this is not a request to fix, but a case where tree-sitter-rst behaves differently than sphinx.

I'm actually happy for tree-sitter-rst to be stricter, but still want to document what I encounter.

Notes
-----
When using ``distutils``, for example in ``setup.py``
::

  import numpy as np
  

Obviously for the human this a literal block... though, tree-sitter consider the :: as an underline of "When using distutils, for example in setup.py" and make that a title.

Well obviously I think that the :: should be at the end of the line and/or have a blank line before. I'll send a PR to fix upstream, but want to let you know.

@stsewd
Copy link
Owner

stsewd commented Feb 12, 2022

Hi, thanks for reporting! This is kind of related to https://github.com/stsewd/tree-sitter-rst#design-decisions (about the length of the adorments). I may try to test how docutils handles that (don't remember if already did 😅), but in any case if this is always parsed as an independent block by docutils, I can check for this special case.

@stsewd stsewd changed the title Literal block parsed as section title is no blank lines. Literal block parsed as section title (:: Jun 12, 2022
@stsewd stsewd changed the title Literal block parsed as section title (:: Literal block parsed as section title is no blank lines Jun 12, 2022
@stsewd stsewd changed the title Literal block parsed as section title is no blank lines Literal block parsed as section title if :: start at a new line Jun 12, 2022
@stsewd stsewd added the bug Something isn't working label Jun 12, 2022
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

2 participants