Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.5.1 instead.

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

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tree_sitter_markdown-0.3.1.tar.gz (251.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tree_sitter_markdown-0.3.1-cp39-abi3-win_arm64.whl (136.4 kB view details)

Uploaded CPython 3.9+Windows ARM64

tree_sitter_markdown-0.3.1-cp39-abi3-win_amd64.whl (142.0 kB view details)

Uploaded CPython 3.9+Windows x86-64

tree_sitter_markdown-0.3.1-cp39-abi3-musllinux_1_2_x86_64.whl (184.0 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ x86-64

tree_sitter_markdown-0.3.1-cp39-abi3-musllinux_1_2_aarch64.whl (184.5 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

tree_sitter_markdown-0.3.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (194.6 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

tree_sitter_markdown-0.3.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (237.7 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

tree_sitter_markdown-0.3.1-cp39-abi3-macosx_11_0_arm64.whl (147.6 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

tree_sitter_markdown-0.3.1-cp39-abi3-macosx_10_9_x86_64.whl (139.3 kB view details)

Uploaded CPython 3.9+macOS 10.9+ x86-64

File details

Details for the file tree_sitter_markdown-0.3.1.tar.gz.

File metadata

  • Download URL: tree_sitter_markdown-0.3.1.tar.gz
  • Upload date:
  • Size: 251.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.6

File hashes

Hashes for tree_sitter_markdown-0.3.1.tar.gz
Algorithm Hash digest
SHA256 e9f57d8a24e737a67620424deda841022c122428d32e71599e907bdf351a0f4d
MD5 a7544d49a969e34e27bbbeda67e40545
BLAKE2b-256 2bd264963527956d5eabb555139fcbbe14dea1b8ab7e2a5e7bd33e1675b843d6

See more details on using hashes here.

File details

Details for the file tree_sitter_markdown-0.3.1-cp39-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_markdown-0.3.1-cp39-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 aa4ce06c4ae00c6594f60955bfbe66e927232973f3449ccdf94d8b3967aba69b
MD5 0b93a8d70d33df0c9d96d01fee06c54d
BLAKE2b-256 145f9d4a06645526af34de42e9672f7a8edfada35b430348d569e749286c4378

See more details on using hashes here.

File details

Details for the file tree_sitter_markdown-0.3.1-cp39-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for tree_sitter_markdown-0.3.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b945f6758295f7b204992702abfb6a70d5511ec001930042e694e1367ce572cd
MD5 f81aee4b867c3f3d651aa8fa18de653d
BLAKE2b-256 60b9a416fbeb7534af2b4ed3f71d27eaac34b1497182e5fbb7ff60b3e74629e7

See more details on using hashes here.

File details

Details for the file tree_sitter_markdown-0.3.1-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_markdown-0.3.1-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 915f57ca536162a1103bf511f89fb0207f433f25cec4327bc8ed2fb1d781545b
MD5 7f18b7ebaecbc14e79bb44ee9ff00577
BLAKE2b-256 b2663086f78b30120fb2e77ac93b3c59ad91fb5644861059d93ae8f520ad93a3

See more details on using hashes here.

File details

Details for the file tree_sitter_markdown-0.3.1-cp39-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_markdown-0.3.1-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 ca0afa7daacb3aa773bf7435774b07d8ad6902364302dc91afac153b524f23c2
MD5 f94b315daee43b23d09b1a07eb9bb345
BLAKE2b-256 dc9bd62bc523c4c3c3ea25ebe7a2daa9f6f1bae40f1355307fbc3f9c16fecbfb

See more details on using hashes here.

File details

Details for the file tree_sitter_markdown-0.3.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_markdown-0.3.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ce9efe2ba1fd6fe887931adf86da3b8c58634ebeff044efb975cd855303f5dfc
MD5 5ab1ca90fb4802bc033bfc1b97825c4b
BLAKE2b-256 505d7fdd1b7f72de0188170f0573021eb9271a036148bce1c0e0299bde8b88df

See more details on using hashes here.

File details

Details for the file tree_sitter_markdown-0.3.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_markdown-0.3.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7e8b6c31d1d79e289e1a3ae6cd11f2087907320faf46dbb2bbf7b2003e6d3fe3
MD5 5abcc342d223f3cd655bcf46be6d542a
BLAKE2b-256 ac63bbad367876398bd3f2f2ecdd509b300152072f498f1b0f150591b9e221ca

See more details on using hashes here.

File details

Details for the file tree_sitter_markdown-0.3.1-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_markdown-0.3.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1a6539dc1105caf0c7c43e0004312c0ac9ff33bd988be4efdbabf2b0eee8829c
MD5 71e20cce7b074cac5bc08755925946a8
BLAKE2b-256 d5cc0a22395e70eb2bb87598873867c7c77599f6d4d14ca4f7926ac2cad97906

See more details on using hashes here.

File details

Details for the file tree_sitter_markdown-0.3.1-cp39-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_markdown-0.3.1-cp39-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 dcba5359423fe1640d51339121af1f3239d9b5f5705a1bde6e464d261d05c07e
MD5 303d077d5c0ce5aa849d5543c9056fcf
BLAKE2b-256 1b85f7632dd191c378eff8f13ff061a144f49dff924b4d1084ce12d4716ca537

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page