Closed mattr- closed 1 year ago
Hi! Did you try this config from the README?
Can I use treesitter markdown parser with octo buffers?
Just add the following lines to your TreeSitter config:
local parser_config = require("nvim-treesitter.parsers").get_parser_configs() parser_config.markdown.filetype_to_parsername = "octo"
Just checked the official Tree-sitter docs, and it seems like they have changed the code to use to:
local ft_to_parser = require "nvim-treesitter.parsers".filetype_to_parsername
ft_to_parser.octo = "markdown"
Just tried it and it seems to work ok. Will update the README's FAQ.
🤦 I didn't even see that in the README. I will learn to read better in the future. 😅
Issue Description
feature request
Describe what happened (or what feature you want)
I'd like octo.nvim to switch from Vim's syntax files to Treesitter for markdown highlighting support. Why? Treesitter's highlighting of markdown is more correct.
For example, if you load mattr-/vigilant-rotary-phone#5 with octo.nvim, you'll notice that the
#4
issue reference is highlighted as a heading, since there's a#
at the start of the line. However, the (commonmark) markdown spec says that there must be a space after a heading delimiter.Here's a screenshot showing the issue:
Describe what you expected to happen
octo.nvim uses tree-sitter for markdown highlight and everybody is happy because tree-sitter is awesome and their parser/highlight is better.
How to reproduce it (as minimally and precisely as possible)
#
will be highlighted as a markdown heading with your chosen color schemeTell us your environment
macos 12.6, neovim 0.7, octo.nvim e634cd1
Anything else we need to know?
This plugin is great and I use it all the time. thank you writing it and being open to feedback ❤️