markdown.nvim icon indicating copy to clipboard operation
markdown.nvim copied to clipboard

Support admonition-callout syntax

Open aleprovencio opened this issue 1 year ago • 1 comments
trafficstars

Hi!

[!NOTE]
I mean if we could have something like this

As seen this is supported by both Github and Obsidian

aleprovencio avatar May 15 '24 19:05 aleprovencio

I think it's a neat idea, but I don't think I'm going to be the one to add it.

This plugin relies heavily on treesitter to do all the real parsing, and for the most part just the vanilla markdown parser.

Identifying these callouts as a result of them not being part of the syntax is going to be tricky, since it'll end up clashing with block_quotes and incomplete links.

Though since it is valid markdown (at least I think it is, the whole incomplete link thing might be a problem), the parser should be able to read it. At that point writing a query to find block quotes where the first line is a link with no actual link could be pretty doable.

In either case if anyone feels like picking this up I'm more than happy to look over the PR.

MeanderingProgrammer avatar May 15 '24 21:05 MeanderingProgrammer

Have added support for the callout text here: https://github.com/MeanderingProgrammer/markdown.nvim/commit/43bbefd410333a04baf62ddfa8bb2a2d30a1bbc1

There is still the issue of matching the highlight of the quote marker to the callout which I'll track here: https://github.com/MeanderingProgrammer/markdown.nvim/issues/24

I'm not really sure if I'll be able to get that working in general, but will give it a shot.

I figured in either case having the text on its own would be nice, even if the quote markers all remain the same color.

MeanderingProgrammer avatar May 22 '24 21:05 MeanderingProgrammer

That's awesome, thank you for reconsidering !

aleprovencio avatar May 23 '24 10:05 aleprovencio