tree-sitter-langs icon indicating copy to clipboard operation
tree-sitter-langs copied to clipboard

Markdown parser doesn't work with quarto files

Open maikol-solis opened this issue 1 year ago • 4 comments

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 image

.qmd image

Why is there a difference, and how can we fix it?

Thanks.

maikol-solis avatar Apr 22 '24 21:04 maikol-solis

Is the markdown mode being used in the qmd file? 🤔

jcs090218 avatar Apr 22 '24 21:04 jcs090218

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

maikol-solis avatar Apr 22 '24 21:04 maikol-solis

Hmmm... would adding poly-quarto-mode here work? 🤔

https://github.com/emacs-tree-sitter/tree-sitter-langs/blob/ccb5529406fe2a1f9e54d6425ebf4931cd4c59c7/tree-sitter-langs.el#L154

jcs090218 avatar Apr 22 '24 23:04 jcs090218

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

image

I don't know if I need to change something else...???

maikol-solis avatar Apr 23 '24 03:04 maikol-solis