{"id":13577301,"url":"https://github.com/tree-sitter-grammars/tree-sitter-markdown","last_synced_at":"2025-05-14T02:00:28.875Z","repository":{"id":37084351,"uuid":"429403657","full_name":"tree-sitter-grammars/tree-sitter-markdown","owner":"tree-sitter-grammars","description":"Markdown grammar for tree-sitter","archived":false,"fork":false,"pushed_at":"2025-05-08T09:43:22.000Z","size":20894,"stargazers_count":472,"open_issues_count":52,"forks_count":73,"subscribers_count":9,"default_branch":"split_parser","last_synced_at":"2025-05-12T01:44:43.936Z","etag":null,"topics":["markdown","parser","tree-sitter"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tree-sitter-grammars.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-18T11:28:59.000Z","updated_at":"2025-05-09T22:02:22.000Z","dependencies_parsed_at":"2023-02-18T15:16:02.636Z","dependency_job_id":"7015785e-8285-4193-a30d-3be1e1f55a03","html_url":"https://github.com/tree-sitter-grammars/tree-sitter-markdown","commit_stats":{"total_commits":243,"total_committers":22,"mean_commits":"11.045454545454545","dds":0.2510288065843621,"last_synced_commit":"d9287a6f36347064e55c36858e9e522eb652c1ad"},"previous_names":["mdeiml/tree-sitter-markdown"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tree-sitter-grammars%2Ftree-sitter-markdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tree-sitter-grammars%2Ftree-sitter-markdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tree-sitter-grammars%2Ftree-sitter-markdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tree-sitter-grammars%2Ftree-sitter-markdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tree-sitter-grammars","download_url":"https://codeload.github.com/tree-sitter-grammars/tree-sitter-markdown/tar.gz/refs/heads/split_parser","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253660820,"owners_count":21943818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["markdown","parser","tree-sitter"],"created_at":"2024-08-01T15:01:20.273Z","updated_at":"2025-05-14T02:00:28.821Z","avatar_url":"https://github.com/tree-sitter-grammars.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# tree-sitter-markdown\n\n[![CI][ci]](https://github.com/tree-sitter-grammars/tree-sitter-markdown/actions)\n[![discord][discord]](https://discord.gg/w7nTvsVJhm)\n[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)\n[![npm][npm]](https://www.npmjs.com/package/@tree-sitter-grammars/tree-sitter-markdown)\n[![crates][crates]](https://crates.io/crates/tree-sitter-md)\n[![pypi][pypi]](https://pypi.org/project/tree-sitter-markdown/)\n\nA Markdown parser for [tree-sitter].\n\n![screenshot](https://github.com/MDeiml/tree-sitter-markdown/blob/split_parser/.github/screenshot.png)\n\nThe parser is designed to read markdown according to the [CommonMark Spec],\nbut some extensions to the spec from different sources such as [Github flavored\nmarkdown] are also included. These can be toggled on or off at compile time.\nFor specifics see [Extensions](#extensions)\n\n## Goals\n\nEven though this parser has existed for some while and obvious issues are\nmostly solved, there are still lots of inaccuracies in the output. These stem\nfrom restricting a complex format such as markdown to the quite restricting\ntree-sitter parsing rules.\n\nAs such it is not recommended to use this parser where correctness is\nimportant. The main goal for this parser is to provide syntactical information\nfor syntax highlighting in parsers such as [neovim] and [helix].\n\n## Contributing\n\nAll contributions are welcome. For details refer to [CONTRIBUTING.md].\n\n## Extensions\n\nExtensions can be enabled at compile time through environment variables. Some\nof them are on by default, these can be disabled with the environment variable\n`NO_DEFAULT_EXTENSIONS`.\n\n| Name | Environment variable | Specification | Default | Also enables |\n|:----:|:--------------------:|:-------------:|:-------:|:------------:|\n| Github flavored markdown | `EXTENSION_GFM` | [link](https://github.github.com/gfm/) | ✓ | Task lists, strikethrough, pipe tables |\n| Task lists | `EXTENSION_TASK_LIST` | [link](https://github.github.com/gfm/#task-list-items-extension-) | ✓ |  |\n| Strikethrough | `EXTENSION_STRIKETHROUGH` | [link](https://github.github.com/gfm/#strikethrough-extension-) | ✓ |  |\n| Pipe tables | `EXTENSION_PIPE_TABLE` | [link](https://github.github.com/gfm/#tables-extension-) | ✓ |  |\n| YAML metadata | `EXTENSION_MINUS_METADATA` | [link](https://gohugo.io/content-management/front-matter/) | ✓ |  |\n| TOML metadata | `EXTENSION_PLUS_METADATA` | [link](https://gohugo.io/content-management/front-matter/) | ✓ |  |\n| Tags | `EXTENSION_TAGS` | [link](https://help.obsidian.md/Editing+and+formatting/Tags#Tag+format) |  |  |\n| Wiki Link | `EXTENSION_WIKI_LINK` | [link](https://help.obsidian.md/Linking+notes+and+files/Internal+links) |  |  |\n\n## Usage in Editors\n\nFor guides on how to use this parser in a specific editor, refer to that\neditor's specific documentation, e.g.\n* [neovim](https://github.com/nvim-treesitter/nvim-treesitter)\n* [helix](https://docs.helix-editor.com/guides/adding_languages.html)\n\n## Standalone usage\n\nTo use the two grammars, first parse the document with the block\ngrammar. Then perform a second parse with the inline grammar using\n`ts_parser_set_included_ranges` to specify which parts are inline content.\nThese parts are marked as `inline` nodes. Children of those inline nodes should\nbe excluded from these ranges. For an example implementation see `lib.rs` in\nthe `bindings` folder.\n\n### Usage with WASM\n\nUnfortunately 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\n\n[CommonMark Spec]: https://spec.commonmark.org/\n[Github flavored markdown]: https://github.github.com/gfm/\n[tree-sitter]: https://tree-sitter.github.io/tree-sitter/\n[neovim]: https://neovim.io/\n[helix]: https://helix-editor.com/\n[CONTRIBUTING.md]: https://github.com/MDeiml/tree-sitter-markdown/blob/split_parser/CONTRIBUTING.md\n[ci]: https://img.shields.io/github/actions/workflow/status/tree-sitter-grammars/tree-sitter-markdown/ci.yml?logo=github\u0026label=CI\n[discord]: https://img.shields.io/discord/1063097320771698699?logo=discord\u0026label=discord\n[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix\u0026label=matrix\n[npm]: https://img.shields.io/npm/v/%40tree-sitter-grammars%2Ftree-sitter-markdown?logo=npm\n[crates]: https://img.shields.io/crates/v/tree-sitter-md?logo=rust\n[pypi]: https://img.shields.io/pypi/v/tree-sitter-markdown?logo=pypi\u0026logoColor=ffd242\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftree-sitter-grammars%2Ftree-sitter-markdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftree-sitter-grammars%2Ftree-sitter-markdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftree-sitter-grammars%2Ftree-sitter-markdown/lists"}