Open Aman9das opened 3 months ago
That's a limitation of using the treesitter markdown grammar also for quarto. You can overwrite the highlighting by taking the query file from https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/markdown_inline/highlights.scm , adding it to your own config at queries/markdown_inline/highlights.scm
and replacing:
(strikethrough) @markup.strikethrough
with
(strikethrough
(emphasis_delimiter)
(strikethrough
(emphasis_delimiter)
(emphasis_delimiter))
(emphasis_delimiter))@markup.strikethrough
such that only double ~~
cause a strikethrough highlight.
Can this be implemented only for quarto files. Like inside ftplugin.
Also I saw this about overriding queries, but didn't understand properly where to put what: https://github.com/nvim-treesitter/nvim-treesitter?tab=readme-ov-file#adding-queries
I got it to work half-way (see commit to my config linked above): On quarto files the window highlighting is overwritten such that strikethrough is no longer strikethrough and only the additional highlight group (should answer your question about where to put those) with two tildes is strikethrough.
Caveat: The highlight group namespace is set per window, not per buffer i.e. if you open a markdown file in the same window as the quarto file it will get the same treatment.
In quarto markdown format,
subscript~1~
creates subscript₁But in the syntax highlighting,
is shown.
ref: https://quarto.org/docs/authoring/markdown-basics.html#text-formatting