Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parsers: Add MDeiml/tree-sitter-markdown as markdown parser #2105

Merged
merged 1 commit into from
Dec 14, 2021

Conversation

theHamsta
Copy link
Member

@theHamsta theHamsta commented Dec 13, 2021

Fixes #872

TODOs

  • Fuzz parser to detect possible SEGFAULTs (already ran 3h, looks ok so far)

@MDeiml
Copy link
Contributor

MDeiml commented Dec 14, 2021

Could you share your fuzzing setup? It would be nice to include it in the repo.

@theHamsta
Copy link
Member Author

theHamsta commented Dec 14, 2021

I explained it here: ikatyang/tree-sitter-markdown#14 (apparently python3 works now fine too)

@theHamsta theHamsta merged commit 387a8f3 into nvim-treesitter:master Dec 14, 2021
@theHamsta theHamsta deleted the bring-back-markdown branch December 14, 2021 14:00
@runiq
Copy link

runiq commented Dec 14, 2021

Does this… does this mean we have an actual, honest-to-god Treesitter markdown parser easily available now? One that could (down the line, ostensibly) be used in LSP docs etc. too?

@MDeiml
Copy link
Contributor

MDeiml commented Dec 14, 2021

As I said in #872 this parser is not yet fully to spec. Also, because of the way that tree-sitter handles its "conflicts" this will never be 100% correct for deeply nested emphasis and the like. But other than that yes!

@lewis6991
Copy link
Member

Found a pretty major problem with the injections using this.

Just open a markdown file with the contents:

```{

(with a newline) at the end.

Gives a heap of E220: Missing }. errors. Tried to fix in this PR

jlesquembre added a commit to jlesquembre/nixpkgs that referenced this pull request Jan 25, 2022
Replace
https://github.com/ikatyang/tree-sitter-markdown
with
https://github.com/MDeiml/tree-sitter-markdown

With neovim, the current markdown parser crashes sometimes.
nvim-treesitter project uses MDeiml parser to avoid those crashes,
take a look to
nvim-treesitter/nvim-treesitter#2105 and
nvim-treesitter/nvim-treesitter#872 to see why
the picked one over the other.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Markdown parser
5 participants