go-tree-sitter icon indicating copy to clipboard operation
go-tree-sitter copied to clipboard

Add markdown grammar

Open FeiyouG opened this issue 3 years ago • 2 comments

FeiyouG avatar Aug 09 '22 07:08 FeiyouG

Hi @FeiyouG ! Thank you for your contribution.

I have noticed in the current form the parser is a bit hard to use.

According to documentation:

The parser is spit into two grammars To use the two grammars, first parse the document with the block grammar. Then perform a second parse with the inline grammar using ts_parser_set_included_ranges to specify which parts are inline content.

Do you think we could do it in the binding itself? Similar to how it is implemented in the Rust binding.

So go-tree-sitter could expose 3 markdown grammars:

  • markdown - to be used in most cases and combines the other 2
  • markdown/inline - for advanced use-cases
  • markdown/block - for advanced use-cases

smacker avatar Aug 14 '22 05:08 smacker

Sure thing. I will be looking into this as soon as I get some free time.

FeiyouG avatar Aug 14 '22 16:08 FeiyouG