Skip to content

bug: random bash code block at the end of markdown preview #328

@hankertrix

Description

@hankertrix

Did you read the documentation and check existing issues?

Neovim version (nvim -v)

0.11.3

Operating system/version

Arch Linux

Browser/version

Mozilla Zen 1.14.5b

Describe the bug

There is a random bash code block containing random garbage at the end of the Markdown preview.

The generated HTML that is responsible for the code block:

<pre>
<code data-highlighted="yes" class="hljs language-bash">
&lt;/enter&gt;&lt;/c-e&gt;&lt;/c-s&gt;&lt;/c-s&gt;&lt;/c-s&gt;&lt;/c-s&gt;
</code>
</pre>

The interesting part is that this only happens for this specific file, and I can't seem to reproduce the issue on other markdown files. The markdown is valid markdown, and GitHub parses it correctly.

Steps To Reproduce

  1. Clone the plugin git clone https://github.com/brianhuster/live-preview.nvim
  2. Open Nvim with minimal repro file nvim -u minimal_init.lua
  3. Download this file.
  4. Open the file.
  5. Use the command LivePreview start in Neovim.
  6. Observe the bug.

Expected Behavior

There should not be anything at the end of the file.

Health

Check dependencies ~
- ✅ OK Nvim 0.11.3 is compatible with Live Preview
- ✅ OK `sh` is available
- ⚠️ WARNING `mini.pick` (optional) is not installed
- ⚠️ WARNING `fzf-lua` (optional) is not installed
- ✅ OK `snacks.picker` is installed
- ⚠️ WARNING `telescope` (optional) is not installed
- ⚠️ WARNING `vim.ui.select` (optional) is not installed

Checkhealth server and process ~
- ✅ OK This Nvim process's PID is 27335
- ✅ OK Server is healthy on port 5500
- ✅ OK Server root: /home/hanker/.dotfiles/tilde/dot_config/yazi/plugins/augment-command.yazi

Check your live-preview.nvim config ~
- Your configuration table >lua
  {
    browser = "default",
    dynamic_root = false,
    picker = "",
    port = 5500,
    sync_scroll = true
  }

Minimal config to reproduce

vim.cmd.set "rtp+=/path/to/live-preview.nvim"

require("livepreview.config").set {}

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