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

Aperta Adatta ai principianti
#36,135 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

Inizia da extractFenceLanguage in apps/web/src/components/chat/MarkdownCodeBlock.logic.ts, che ricade su "text" quando non è presente una classe language-*. Poi controlla MarkdownCodeBlockTitleContent in MarkdownCodeBlock.tsx, che mostra quel valore come etichetta dell'intestazione. È completato quando un fence senza linguaggio non mostra alcuna etichetta, mentre un fence esplicito text ne mostra una, e il valore predefinito dell'evidenziazione resta invariato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
24.8k
Fork
6.4k
Merge medio
59m
PR unite (30g)
418

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pingdotgg/t3code

Tutte le issue di pingdotgg/t3code

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.