Skip to content

bug: links with inline code in headings aren't displayed entirely with heading = { width = "block", }, #124

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
1 task done
xfzv opened this issue Aug 7, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@xfzv
Copy link

xfzv commented Aug 7, 2024

Neovim version (nvim -v)

NVIM v0.11.0-dev-590+g7031949be-dirty

Operating system

Linux

Terminal emulator / GUI

kitty 0.35.2

Describe the bug

If using inline code for a link in a heading, and also using

heading = {
      width = "block",
    },

then not all characters are displayed.

Screenshots:

# [`abc`](https://test.org)

01
02

# [`abcd`](https://test.org)

03
04

# [`abcde`](https://test.org)

05
06

and so on.

Expected behavior

All characters are displayed inside the inline code

Healthcheck output

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

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

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

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

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

return {
  "MeanderingProgrammer/render-markdown.nvim",
  ft = "markdown",
  opts = {
    heading = {
      width = "block",
    },
  },
}

Confirmations

  • I have provided markdown text for any screenshots used in my description & understand that my issue will be closed if I have not

Additional information

No response

@xfzv xfzv added the bug Something isn't working label Aug 7, 2024
MeanderingProgrammer added a commit that referenced this issue Aug 7, 2024
# Details

Issue: #124

Calculation for heading width did not take into account any inlined
link icons added. This would cause text to be hidden when using the
block width.

To fix this use similar logic to the table padding caclulation and add
the width of any inlined icons.
@MeanderingProgrammer
Copy link
Owner

Thanks for reporting this!

The problem is slightly different, it's caused by the link in the heading, not the inline code. Links without inline code have the same problem.

Fixed this here: f365cef

Please update and LMK if it works for you

@xfzv
Copy link
Author

xfzv commented Aug 8, 2024

Can confirm f365cef solves the problem on my end.

Thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants