Skip to main content

tree-sitter-markdown

CI discord matrix npm crates pypi

A Markdown parser for tree-sitter.

screenshot

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

Goals

Even though this parser has existed for some while and obvious issues are mostly solved, there are still lots of inaccuracies 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.

Contributing

All contributions are welcome. For details refer to CONTRIBUTING.md.

Extensions

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 NO_DEFAULT_EXTENSIONS.

Name Environment variable Specification Default Also enables
Github flavored markdown EXTENSION_GFM link ✓ Task lists, strikethrough, pipe tables
Task lists EXTENSION_TASK_LIST link ✓
Strikethrough EXTENSION_STRIKETHROUGH link ✓
Pipe tables EXTENSION_PIPE_TABLE link ✓
YAML metadata EXTENSION_MINUS_METADATA link ✓
TOML metadata EXTENSION_PLUS_METADATA link ✓
Tags EXTENSION_TAGS link
Wiki Link EXTENSION_WIKI_LINK link

Usage in Editors

For guides on how to use this parser in a specific editor, refer to that editor's specific documentation, e.g.

Standalone usage

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 lib.rs in the bindings folder.

Usage with WASM

Unfortunately using this parser with WASM/web-tree-sitter does not work out of the box at the moment. This is because the parser uses some C functions that are not exported by tree-sitter by default. To fix this you can statically link the parser to tree-sitter. See also https://github.com/tree-sitter/tree-sitter/issues/949, https://github.com/MDeiml/tree-sitter-markdown/issues/126, and https://github.com/MDeiml/tree-sitter-markdown/issues/93

Metadata

Release files for tree-sitter-markdown 0.5.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tree-sitter-markdown 0.5.4
File Size Uploaded Provenance
tree_sitter_markdown-0.5.4.tar.gz 253.8 kB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for tree-sitter-markdown 0.5.4
File
tree_sitter_markdown-0.5.4-cp310-abi3-win_arm64.whl CPython 3.10 abi3 Windows ARM64 Details
tree_sitter_markdown-0.5.4-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
tree_sitter_markdown-0.5.4-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details
tree_sitter_markdown-0.5.4-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details
tree_sitter_markdown-0.5.4-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details
tree_sitter_markdown-0.5.4-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64, Linux glibc 2.17+ ARM64 Details
tree_sitter_markdown-0.5.4-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
tree_sitter_markdown-0.5.4-cp310-abi3-macosx_10_9_x86_64.whl CPython 3.10 abi3 macOS 10.9+ x86-64 Details

Total release size: 1.6 MB

Release files / tree_sitter_markdown-0.5.4.tar.gz

Download URL tree_sitter_markdown-0.5.4.tar.gz
Size 253.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5fc422637d41aa5b286551a8e6fa674733d92dac1c6a42c1d4ada0be59045bd3
BLAKE2b-256 checksum
How to use checksums
10eed54192a828a931082bcb4f71d4e66369318ae8fb0f30758ade716c6c92fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tree_sitter_markdown-0.5.4-cp310-abi3-win_arm64.whl

Download URL tree_sitter_markdown-0.5.4-cp310-abi3-win_arm64.whl
Size 140.7 kB
Tags CPython 3.10 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
898a2124be2bc9994dec979de146c3d6cf0e967baf59d5c2fe7ff77c6d5c0cae
BLAKE2b-256 checksum
How to use checksums
3138231a22c2aa15badc4a7f70368bd62ad672b9bb0daf3fad9a0a5d2ad201e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tree_sitter_markdown-0.5.4-cp310-abi3-win_amd64.whl

Download URL tree_sitter_markdown-0.5.4-cp310-abi3-win_amd64.whl
Size 143.0 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
99f0e61ccfc1a9f80f886a510c74690d205de5e51eefd368c41a4cdf73b18817
BLAKE2b-256 checksum
How to use checksums
398311598ac8aca1b6f129f82ed00ccec90bc072a3f48dbd6d9fc626349cd1cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tree_sitter_markdown-0.5.4-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL tree_sitter_markdown-0.5.4-cp310-abi3-musllinux_1_2_x86_64.whl
Size 186.7 kB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
333a03bd72c51323594e33a8551a8d0aad60ce93b8e02e5f7aaae208f9cd2243
BLAKE2b-256 checksum
How to use checksums
d9ccf3351f4bb923195112cee407ae2ae6dd40c27b5b0936c3cca7ffc88d39c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tree_sitter_markdown-0.5.4-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL tree_sitter_markdown-0.5.4-cp310-abi3-musllinux_1_2_aarch64.whl
Size 187.1 kB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
b46f2d9cd9887092f3a96853f7c31da6b806d42c00e57f589bb60af102b589f4
BLAKE2b-256 checksum
How to use checksums
20c8158788fb22f174574219c17897eebf80e182bac91a24bd6eb4749a95f40e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tree_sitter_markdown-0.5.4-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL tree_sitter_markdown-0.5.4-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 188.8 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
27874a3edabdf4540a278c8ad517faba305fcc389a205bfd82cfd622229838e0
BLAKE2b-256 checksum
How to use checksums
b34560c0b093a9688fc48835544338268209bab1a7d6cab2978fac6083ef431d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tree_sitter_markdown-0.5.4-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Download URL tree_sitter_markdown-0.5.4-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 188.3 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
6a32f03547abbb5f444b2ed73d3d3b89c243b52c29bed2e384df06b98d66bfae
BLAKE2b-256 checksum
How to use checksums
3b71c339d85c95d7f1691a682aab400bc87b5598214eb775d81ec7942bcbc808
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tree_sitter_markdown-0.5.4-cp310-abi3-macosx_11_0_arm64.whl

Download URL tree_sitter_markdown-0.5.4-cp310-abi3-macosx_11_0_arm64.whl
Size 149.6 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
fcee0e62898deb43a2686508606ed3bcbd6e0e20050dd9423b034171e8315eb3
BLAKE2b-256 checksum
How to use checksums
cdf50fb8fc8b0d0c0e7dcf2878096959ab1dab5b205e52d0c5aed96c17e47b3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tree_sitter_markdown-0.5.4-cp310-abi3-macosx_10_9_x86_64.whl

Download URL tree_sitter_markdown-0.5.4-cp310-abi3-macosx_10_9_x86_64.whl
Size 141.4 kB
Tags CPython 3.10 abi3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
c7b007683159a0bf0a57dbe4b232b387d6f68a75889c8e1fea114b6832cabeca
BLAKE2b-256 checksum
How to use checksums
38f0b46faba6a351d187ba30e3b7046ff6582c3620da712525bd041aadf188ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for tree-sitter-markdown 0.5.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page