Skip to content

bug: backticks not being concealed by default #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gennaro-tedesco opened this issue Jul 23, 2024 · 5 comments
Closed

bug: backticks not being concealed by default #89

gennaro-tedesco opened this issue Jul 23, 2024 · 5 comments
Labels
not a bug Not a bug in this plugin

Comments

@gennaro-tedesco
Copy link

gennaro-tedesco commented Jul 23, 2024

Neovim version (nvim -v)

NVIM v0.10.0 
Build type: RelWithDebInfo LuaJIT 2.1.1713484068

Operating system

MacOs

Terminal emulator / GUI

iTerm

Describe the bug

More than a bug a request for clarification: I am running the plugin with default settings, however I cannot reproduce the visuals that appear in your demo screenshots, in particular concealing of backticks isn't show (the backticks still are).

See screenshot above: I have copied&pasted a portion of your README.md, expecting it to automatically render as in the gifs, however the concealing both for inline and block code isn't correct (or am I mistaken)?

Screenshot 2024-07-23 at 15 08 48

Expected behavior

Backticks do not appear when concealed.

Healthcheck output (:checkhealth render-markdown)

render-markdown: require("render-markdown.health").check()

markdown.nvim [neovim version] ~
- OK Version >= 0.10

markdown.nvim [configuration] ~
- OK valid

markdown.nvim [nvim-treesitter] ~
- OK installed
- OK markdown: parser installed
- OK markdown_inline: parser installed
- WARNING latex: parser not installed
  - ADVICE:
    - Disable LaTeX support to avoid this warning by setting { latex = { enabled = false } }
- OK highlights enabled

markdown.nvim [executables] ~
- WARNING latex2text: not installed
  - ADVICE:
    - Disable LaTeX support to avoid this warning by setting { latex = { enabled = false } }

Additional information

No response

@gennaro-tedesco gennaro-tedesco added the bug Something isn't working label Jul 23, 2024
@MeanderingProgrammer
Copy link
Owner

Backticks are concealed by the nvim-treesitter here: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/markdown/highlights.scm#L50-L52

Do you override or extend highlights.scm in any way?

@gennaro-tedesco
Copy link
Author

gennaro-tedesco commented Jul 24, 2024

Do you override or extend highlights.scm in any way?

No, I do not.

However, I noticed that the highlight group @markup.raw.block does not exist (is not being created?). Shall I create it manually and then conceal it?

@MeanderingProgrammer
Copy link
Owner

MeanderingProgrammer commented Jul 25, 2024

No, that shouldn't make any real difference.

Your color scheme should make these groups, @markup.raw.block is an agreed upon naming convention: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#highlights.

I looked at your treesitter config and found this line: https://github.com/gennaro-tedesco/dotfiles/blob/master/nvim/lua/plugins/treesitter.lua#L7

highlight = { enable = true, disable = { "markdown" } },

Concealing relies on treesitter highlights, they are disabled for markdown, hence concealing does not work for non inline elements like code blocks.

To fix this remove the disable setting:

highlight = { enable = true },

While I wrote a healthcheck to validate that highlights were enabled, I did not account for someone explicitly disabling it for markdown, that's a new one haha.

MeanderingProgrammer added a commit that referenced this issue Jul 25, 2024
## Details

Rather than checking if the highlight module is enabled for
treesitter check that each language is individually enabled.

This should hanlde cases like this:
#89

Minor refactor, standardize on `function M.method` instead of
`M.method = function`. Used both in a few places, better to
stick to one.
@MeanderingProgrammer
Copy link
Owner

Updated the healthcheck to account for this: 8d14528.

Feel free to re-open if the fix from the previous comment does not work.

@gennaro-tedesco
Copy link
Author

You are perfectly right, quite silly of me to not check my treesitter options first. Thank you a lot for taking the time to even dig into my config for it, much appreciated.

Now it all works fine!

@MeanderingProgrammer MeanderingProgrammer added not a bug Not a bug in this plugin and removed bug Something isn't working labels Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not a bug Not a bug in this plugin
Projects
None yet
Development

No branches or pull requests

2 participants