github / github/copilot-cli

Plan canvas markdown renderer: language-tagged code fence not closed by a bare closing fence, breaking rest of document

未關閉
#4,250 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Shell
星號
11.2k
分支
1.9k
平均合併
14 小時 16 分鐘
30 天內合併 PR
6

描述

### Summary

In the desktop app's **Plan** canvas (the built-in markdown viewer/editor), a fenced code block that has a **language info-string on its opening fence** (e.g. ` ```csharp `) is not closed by a bare closing fence (` ``` `). The renderer treats the bare closing fence as content and leaves the code block "open," so **the entire remainder of the document renders as code** — headings (`##`), blockquotes (`>`), lists, and inline code all stop being parsed as markdown.

Per the [CommonMark spec §4.5](https://spec.commonmark.org/0.31.2/#fenced-code-blocks), a closing code fence **must not** carry an info string; a bare ` ``` ` is the *correct* way to close a ` ```csharp ` block. VS Code (and GitHub itself) render all the variations below correctly, so the file is valid — the app's renderer is non-conformant.

### Repro

Open any `.md` file in the app's **Plan** panel containing:

- Opening fence with a language tag (` ```csharp `)
- Some code lines
- A bare closing fence (` ``` `)
- Followed by a heading / blockquote / more markdown

Observed behavior by variant (same content, only the fences changed):

| Opening fence | Closing fence | App Plan renderer | VS Code |
| --- | --- | --- | --- |
| bare ` ``` ` | bare ` ``` ` | Minor glitch: a stray ` ``` ` line leaks out, but content after the block recovers | ✅ correct |
| ` ```csharp ` | bare ` ``` ` | **Broken: bare closer not matched → the block never closes and the entire rest of the document renders as code** | ✅ correct |
| 4-space indented block (no fences) | n/a | ✅ correct | ✅ correct |

### Expected

A bare ` ``` ` closing fence should close a language-tagged opening fence (` ```csharp `), matching CommonMark and VS Code. Content after the block should resume normal markdown parsing.

### Actual

The language-tagged block is only closed by an identically-tagged fence; a spec-correct bare closer is swallowed as content, breaking rendering for everything below the block.

### Workaround

- Use an indented (4-space) code block instead of a fenced one, **or**
- Omit the language info-string so both fences are bare (this still leaks a stray ` ``` ` line but at least doesn't break the rest of the doc).

### Environment

- GitHub Copilot desktop app, version 1.0.71
- OS: Windows 11
- Surface: **Plan** canvas (markdown viewer/editor), `media=text/markdown`

### Notes

Screenshots demonstrating all three variants (app vs. VS Code side-by-side) are available and can be attached to this issue.

貢獻指南

開啟貢獻指南

研究方向

先在桌面應用程式的 Plan 面板中,使用一個包含帶有語言標籤的開啟圍欄、裸結束圍欄以及其後 Markdown 內容的 Markdown 檔案重現問題。當裸結束圍欄能結束圍欄區塊,且後續的標題、引用區塊、清單和行內程式碼都能正常呈現,符合 CommonMark 和 VS Code 時,修正便完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
markdown
領域
content, desktop
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
冷清
描述清晰度
基本清楚
新手友好度
55/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。