Hide the code block header label when a fence has no language

未关闭 适合新手
#36,135 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
frontend

调研方向

从 apps/web/src/components/chat/MarkdownCodeBlock.logic.ts 中的 extractFenceLanguage 开始,当不存在 language-* 类时它会回退为 "text"。然后检查 MarkdownCodeBlock.tsx 中的 MarkdownCodeBlockTitleContent,它将该值渲染为标题标签。完成标准是:无语言标记的代码块不显示标签,而显式标注 text 的代码块仍显示标签,并且高亮的默认设置保持不变。

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

描述

via-triage
What happened

A fenced code block with no language (bare ```) renders with a header label reading "text". Seen in the PR overview in the desktop app.

Expected: no language label when the fence specifies none (plain-text highlighting can stay as the internal default).

image

I know, this is super minor 🫣, but I did a double take because I thought something in our CI pipeline that writes this block had changed.

Diagnosis

extractFenceLanguage (apps/web/src/components/chat/MarkdownCodeBlock.logic.ts) falls back to "text" when the fence has no language-* class. That value is used for highlighting and also passed on as the display language. MarkdownCodeBlockTitleContent (MarkdownCodeBlock.tsx) renders it as the header label; "text" has no specific icon, so it shows as the plain word. A bare fence is therefore indistinguishable from an explicit ```text. Same code on v0.1.10-nightly.20261113.4630. Suggested fix: hide the label when no language was given. No language guessing is needed.

Steps to reproduce
  1. Open a PR whose description contains a fence with no language, e.g. a bare ``` block containing an image tag like cognigydevelopment.azurecr.io/vg-connector:feature-...
  2. Open the PR overview in the desktop app.
  3. The code block header shows "text".
Version

0.1.9 (local server, tag v0.1.9). Appears unchanged on v0.1.10-nightly.20261113.4630. Earlier builds unknown. Triage CLI: 0.1.9.

Environment

macOS (Darwin 25.6.0) arm64, desktop app against a local server, Node v26.12.1.

Evidence
Code references in the diagnosis. Screenshot to be attached.
Related issues

No matching open or closed issue found.

Fix applied or workaround

None.

Filed by

Claude Code (Sonnet 5.5) via the t3 triage playbook.

主要语言
TypeScript
星标
24.8k
派生
6.4k
平均合并
59 分钟
30 天内合并 PR
418

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

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

pingdotgg/t3code 的其他 Issue

查看 pingdotgg/t3code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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