OXY2DEV / markview.nvim

An experimental markdown previewer for Neovim
Apache License 2.0
673 stars 25 forks source link

[Feature Request] View escaped characters without leading "\" #44

Closed 22ispencer closed 1 week ago

22ispencer commented 2 weeks ago

When converting files from html to markdown using pandoc, quotes (both single and double) are escaped with a "\" prefix. Would it be possible to hide these leading slashes?

OXY2DEV commented 2 weeks ago

When converting files from html to markdown using pandoc, quotes (both single and double) are escaped with a "\" prefix. Would it be possible to hide these leading slashes?

That's actually very hard to do since Tree-sitter doesn't really know where something is.

You can probably use matchadd()(you will need some robust regex for it or else it might not work).

Doing it inside the plugin can be hard since I will have to constantly check for them in inline codes, links , tables etc. at the same time I will have not conceal them in places like code_blocks.

It is not really performant to check every line(or else we wouldn't use Tree-sitter for everything). Plus it's hard to keep track of. Not to mention there are too many what-ifs.

This should probably be a formatters job since that's something they can do. So, you should probably look if any of the markdown formatters can achieve that.

22ispencer commented 2 weeks ago

I'll look into it more, thanks for the quick reply!