Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Code fence lines are fully hidden in .qmd buffers unless a .md file was opened first

未关闭
#205 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
56/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
lua, neovim

调研方向

Start by reproducing the issue in Neovim with a .qmd file opened before any .md file, then compare the behavior after opening Markdown. The report points to nvim-treesitter’s Markdown highlights.scm conceal rules and notes that setting conceallevel=0 restores the fences. Find the initialization path that differs between those cases; done when fence lines remain visible in the reported .qmd startup sequence without requiring the workaround.

由索引模型根据 Issue 内容生成。

描述

In a .qmd buffer, the opening and closing lines of a fenced code block (```python / ```) are completely hidden unless the cursor is on them. If I first open any .md file in the same session and then open the .qmd, the fence lines are shown normally (screenshots below).

Findings

  • The hiding seems to come from nvim-treesitter's markdown highlights.scm, which sets conceal and conceal_lines on fenced_code_block_delimiter and the info_string language.
  • With set conceallevel=0 the fences reappear, so it's treesitter conceal, not syntax conceal (syntax is empty, synconcealed() returns 0).
  • The query file used is the same in both states.
  • Manually loading render-markdown.nvim in the broken state (:Lazy load render-markdown.nvim) changes nothing, and its file_types doesn't include quarto. So opening a markdown file triggers something else that affects .qmd buffers.

Workaround

Creating a scratch buffer with filetype=markdown once, on the first quarto FileType event, fixes it:

vim.api.nvim_create_autocmd("FileType", {
  -- When opening a quarto file with quarto-nvim, first trigger a load with render-markdown to ensure its proper initialization.
  -- This works around an issue where loading a quarto file before markdown results in concealed code block fences.
  pattern = "quarto",
  once = true,
  callback = function()
    local scratch = vim.api.nvim_create_buf(false, true)
    vim.bo[scratch].filetype = "markdown"
    vim.schedule(function()
      vim.api.nvim_buf_delete(scratch, { force = true })
    end)
  end,
})

Steps to reproduce

  1. Start Neovim and open a .qmd file containing a Python code block.
  2. Move the cursor off the fence lines: they disappear.
  3. Open any .md file, then delete the .qmd buffer and reopen it: the fences are visible.

Environment

  • Neovim: 0.12.4
  • OS: macOS
  • Distribution: LazyVim
  • quarto-nvim / nvim-treesitter / render-markdown.nvim: v2.1.0 / e289100 / 245956d
  • Config: ft = "quarto", opts = { codeRunner = { enabled = true, default_method = "molten", }, }

Screenshots

.qmd opened first

.qmd opened after .md

主要语言
Lua
星标
533
派生
21
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

quarto-dev/quarto-nvim 的其他 Issue

查看 quarto-dev/quarto-nvim 的全部 Issue

相似的 Issue

更多 Lua Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。