tree-sitter-langs
tree-sitter-langs copied to clipboard
Markdown parser doesn't work with quarto files
Hi!
I'm trying to visualize some quarto files, which are basically markdown with some R or python chunks to execute data analysis.
The problem is if I display the same text in a .md and a .qmd the results are entirely different.
.md
.qmd
Why is there a difference, and how can we fix it?
Thanks.
Is the markdown mode being used in the qmd file? 🤔
Yes, it uses poly-quarto-mode (https://github.com/quarto-dev/quarto-emacs).
I have recorded exactly what I am seeing on my laptop.
https://github.com/emacs-tree-sitter/tree-sitter-langs/assets/4078489/e5557744-8a2d-43db-9982-2a91e5b3bb17
Hmmm... would adding poly-quarto-mode here work? 🤔
https://github.com/emacs-tree-sitter/tree-sitter-langs/blob/ccb5529406fe2a1f9e54d6425ebf4931cd4c59c7/tree-sitter-langs.el#L154
I have this in my config.el (doom-emacs)
(after! tree-sitter
(add-to-list 'tree-sitter-major-mode-language-alist '(poly-quarto-mode . markdown)))
I don't know if I need to change something else...???