Skip to content

bug: Table render issues of indentation and alignment #142

@xlucn

Description

@xlucn

Neovim version (nvim -v)

0.10.1

Operating system

Arch Linux

Terminal emulator / GUI

foot

Describe the bug

  1. Cell content is rendered with the last letter right-aligned, while the rest is left aligned. This happens when the content is directly enclosed by || with no spaces between the end of the content and |
|aaaaaa|bb|cccccc|
|-|-|-|
|yes|nooooooooo|no |

20240822_13h33m30s_grim

  1. If the table is indented (less than 4 spaces, otherwise it's treated as code), the rendered borders are not indented
  |aa|bb|cc|
  |-|-|-|
  |1|2|3|

20240822_13h35m41s_grim

Expected behavior

  1. The whole cell content is left aligned.
  2. The whole table will indent as the code does.

Healthcheck output

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

render-markdown.nvim [version] ~
- OK plugin 6.1.3
- 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

render-markdown.nvim [executables] ~
- OK none to check

render-markdown.nvim [conflicts] ~
- OK headlines: not installed
- WARNING obsidian: installed
  - ADVICE:
    - Ensure UI is disabled by setting ui = { enable = false } in obsidian.nvim config
    - Acknowledge conflicts to avoid this warning by setting { acknowledge_conflicts = true }

Plugin configuration

lazy.nvim config:

    {
        "MeanderingProgrammer/render-markdown.nvim",
        ft = "markdown",
        dependencies = {
            'nvim-treesitter/nvim-treesitter',
            'nvim-tree/nvim-web-devicons'
        },
    },

Plugin error log

  • (file empty)

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

I have just checkout the latest commit 0a8b941 for the tests above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions