|0.1.5||Mar 5, 2023|
|0.1.4||Mar 2, 2023|
|0.1.3||Feb 28, 2023|
|0.1.2||Oct 27, 2022|
|0.0.1||Apr 26, 2022|
#55 in Text editors
75 downloads per month
Used in cbfmt
A markdown parser for tree-sitter.
The parser is designed to read markdown according to the CommonMark Spec, but some extensions to the spec from different sources such as Github flavored markdown are also included. These can be toggled on or off at compile time. For specifics see Extensions
Even though this parser has existed for some while and obvious issues are mostly solved, there are still lots of inaccuarcies in the output. These stem from restricting a complex format such as markdown to the quite restricting tree-sitter parsing rules.
As such it is not recommended to use this parser where correctness is important. The main goal for this parser is to provide syntactical information for syntax highlighting in parsers such as neovim and helix.
All contributions are welcome. For details refer to CONTRIBUTING.md.
Extensions can be enabled at compile time through environment variables. Some
of them are on by default, these can be disabled with the environment variable
|Name||Environment variable||Specification||Default||Also enables|
|Github flavored markdown||
||link||✓||Task lists, strikethrough, pipe tables|
Usage in Editors
For guides on how to use this parser in a specific editor, refer to that editor's specific documentation, e.g.
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.
These parts are marked as
inline nodes. Children of those inline nodes should
be excluded from these ranges. For an example implementation see