Skip to content
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

bug: Text inside backticks in a table causes table to render incorrectly #300

Closed
2 tasks done
ObjectsCountries opened this issue Jan 16, 2025 · 3 comments
Closed
2 tasks done
Labels
not a bug Not a bug in this plugin

Comments

@ObjectsCountries
Copy link

Neovim version (nvim -v)

0.10.3

Neovim distribution

N/A

Operating system

EndeavourOS

Terminal emulator / GUI

Kitty

Describe the bug

Image

Contents of table above:

|Component|Using|Package|
|-|-|-|
|Icons|Papirus|`papirus-icon-theme`|
|Color of Folders|Papirus Folders script|`papirus-folders` (AUR)|
|`ls` replacement|`eza`|`eza`|
|`cat` replacement|`bat`|`bat`|
|`git diff` replacement|Delta|`git-delta`|

The plugin seems to ignore the backticks when rendering the table; as a result, the backticks move the column borders.

Expected behavior

The columns should take into account the backticks and render properly.

Healthcheck output

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

render-markdown.nvim [version] ~
- OK plugin 7.8.8
- OK neovim >= 0.10

render-markdown.nvim [configuration] ~
- OK valid

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

render-markdown.nvim [icons] ~
- OK using: mini.icons

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

render-markdown.nvim [conflicts] ~
- OK headlines: not installed
- OK obsidian: not installed

Plugin configuration

{
    "MeanderingProgrammer/render-markdown.nvim",
    dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.icons" },
    ---@module 'render-markdown'
    ---@type render.md.UserConfig
    opts = {},
},

Plugin error log

N/A

Confirmations

  • I have updated this plugin to the latest version using my plugin manager
  • I have provided the text contained in all screenshots as raw text in this issue. This means if there is a screenshot below it is the copy pasted contents of the file in the screenshot. I understand that my issue will be closed if I have not.

Additional information

No response

@ObjectsCountries ObjectsCountries added the bug Something isn't working label Jan 16, 2025
@MeanderingProgrammer
Copy link
Owner

There are 2 relevant errors in your healthcheck:

- ERROR markdown: highlight not enabled
- ERROR markdown_inline: highlight not enabled

You need to enable the nvim-treesitter highlights module:

require('nvim-treesitter.configs').setup({
  ...
  highlight = { enable = true },
  ...
})

@ObjectsCountries
Copy link
Author

Thank you. My apologies for the inaccurate bug report.

MeanderingProgrammer added a commit that referenced this issue Jan 16, 2025
## Details

Issue: #300

While we report inactive highlights in the healthcheck we may as well
handle the case when highlights are not active accurately. To do this
all we need to do is check if highlights are active for the buffer
before iterating through the highlighter query.
@MeanderingProgrammer
Copy link
Owner

No worries! I checked if there was a way I could determine if highlights are active and turns out it's very straightforward.

While having highlights enabled is still preferred the plugin now handles the case when they are not: ad05586.

So if you want to keep highlights disabled you can and it should all render properly now.

@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