Plan canvas markdown renderer: language-tagged code fence not closed by a bare closing fence, breaking rest of document
まだ誰も着手していません。
- 主要言語
- Shell
- スター
- 11.2k
- フォーク
- 1.9k
- 平均マージ
- 14時間 16分
- マージ済み PR(30日)
- 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, 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.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、言語タグ付きの開始フェンス、単独の終了フェンス、その後のMarkdownコンテンツを含むMarkdownファイルを使い、デスクトップアプリのPlanパネルで問題を再現します。単独の終了フェンスでフェンスブロックが終了し、その後の見出し、blockquotes、リスト、インラインコードがCommonMarkおよびVS Codeに一致して通常どおりレンダリングされれば、修正は完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- markdown
- 領域
- content, desktop
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 55/100