Skip to content

🐞 Bug: Markdown tables without leading or trailing pipes don't render correctly #308

@daviewales

Description

@daviewales

🤖 Which branch are you using?

  • dev
  • main

📜 Issue description:

Suppose I have the following markdown tables:

Column A | Column B
-------- | --------
1        | 2
3        | 4


| Column A | Column B |
| -------- | -------- |
| 1        | 2        |
| 3        | 4        |

The first table (without the leading and trailing pipes) doesn't render correctly:

Image

However, this is a common format for markdown tables. For example, see: PHP Markdown Extra and Python Markdown (used by MkDocs). It's also supported in GitHub Markdown.

📑 Reproduction steps:

  1. neovim -u minit.lua test.md
  2. Paste the text above
  3. Press Escape to switch to normal mode to see the preview

💻 Minimal init:

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
    spec = {
        {
            "nvim-treesitter/nvim-treesitter",
            build = ":TSUpdate",

            ensure_installed = { "html", "latex", "markdown", "markdown_inline", "typst", "yaml" }
        },
        {
            "OXY2DEV/markview.nvim",
            -- branch = "dev",
            lazy = false
        }
    },
});

📜 Logs:

Logs
Plugin: markview.nvim
Time: 13/03/2025 3:50:54 PM
Nvim version: 0.10.2
Colorscheme: tokyonight-moon

Level description,
  1 = START
  2 = PAUSE
  3 = STOP
  4 = ERROR
  5 = LOG
  6 = ENABLE
  7 = DISABLE
  8 = ATTACH
  9 = DETACH

Trace,
----------------------------------------•-------•-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
               Time-stamp               | Level |                                                                                 Action                                                                                
----------------------------------------•-------•-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
              %k:%M:%S                  |   1   | Start
              %k:%M:%S                  |   5   | Created highlight groups
              %k:%M:%S                  |   5   | Added tree-sitter directive {conceal-patch!}
              %k:%M:%S                  |   8   | Attached: 1
                %k:%M:%S                |   1   | Callback: {on_attach}
                %k:%M:%S                |   1   | Callback: {on_enable}
                %k:%M:%S                |   1   | Clearing: 1
                %k:%M:%S                |   3   | Clearing(end, 0ms): 1
                %k:%M:%S                |   1   | Parsing(start): 1
                %k:%M:%S                |   3   | Parsing(end, 1ms): 1
                %k:%M:%S                |   1   | Rendering(main): 1
                  %k:%M:%S              |   3   | Render(main): 0ms
                  %k:%M:%S              |   3   | Render(post): 0ms
                %k:%M:%S                |   3   | Rendering(end, 0ms): 1
                %k:%M:%S                |   1   | Callback: {on_hybrid_enable}
              %k:%M:%S                  |   2   | Mode(i): 1
                %k:%M:%S                |   1   | Clearing: 1
                %k:%M:%S                |   3   | Clearing(end, 0ms): 1
                %k:%M:%S                |   1   | Callback: {on_mode_change}
              %k:%M:%S                  |   1   | Mode(n): 1
                %k:%M:%S                |   1   | Clearing: 1
                %k:%M:%S                |   3   | Clearing(end, 0ms): 1
                %k:%M:%S                |   1   | Parsing(start): 1
                %k:%M:%S                |   3   | Parsing(end, 9ms): 1
                %k:%M:%S                |   1   | Rendering(main): 1
                  %k:%M:%S              |   3   | Render(main): 0ms
                  %k:%M:%S              |   3   | Render(post): 0ms
                %k:%M:%S                |   3   | Rendering(end, 0ms): 1
                %k:%M:%S                |   1   | Callback: {on_mode_change}
              %k:%M:%S                  |   1   | Mode(c): 1
                %k:%M:%S                |   1   | Callback: {on_mode_change}
              %k:%M:%S                  |   1   | Mode(n): 1
                %k:%M:%S                |   1   | Callback: {on_mode_change}
----------------------------------------•-------•-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

vim:nomodifiable:nowrap:nospell:

Neovim version:

NVIM v0.10.2 Build type: Release LuaJIT 2.1.1713484068

✅ Expected behavior:

Both tables would render correctly.

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