stsewd / tree-sitter-rst

reStructuredText grammar for tree-sitter
https://stsewd.dev/tree-sitter-rst/
MIT License
50 stars 7 forks source link

Directive vs comments when no space after `::` #46

Open Carreau opened 11 months ago

Carreau commented 11 months ago

FYI, docutils seem to support not having a space (and emit a directive). Tree sitter make it a comment if there is no space.

The spec is unclear.

from the https://docutils.sourceforge.io/docs/ref/rst/directives.html

followed by the directive type and two colons (collectively, the "directive marker"

https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#directives

followed by the directive type, two colons, and whitespace (together called the "directive marker"

Emphasis mine.

Carreau commented 11 months ago

Feel free to close, I just wanted to just have a note of it – I think the current behavior is better.

stsewd commented 10 months ago

Yeah, I have found several of things like this in the spec that docutils follows loosely. I'm not 100% sure about what to do here...