Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Quarto visual mode / source mode switching breaks equation block formatting and syntax highlighting

Aperta
#1,047 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
typescript
Ambito
tooling

Direzione di ricerca

Start by reproducing the visual/source mode switch in a Quarto .qmd document using the multi-line equation and {#eq-label} examples from the report. Trace the visual/source mode entry point that reformats equation blocks, then verify that the closing $$ and label remain together, cross-references resolve, and following R code blocks retain their gray background.

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

Descrizione

bug visual-editor
Bug description

👋hello! This issue was originally posted at https://github.com/posit-dev/positron/issues/14763#issue-4838651653, and is reposted here at the request of @juliasilge .

When switching between visual mode and source mode in a Quarto .qmd document, the editor reformats multi-line equation blocks

$$
equation
$$

into single-line form

$$equation$$

, which causes two related bugs:

Bug 1 — Cross-reference label malformation

After a visual→source mode switch, a properly formatted numbered equation like:

$$
y_i = \alpha + \sum_{j=1}^{p} \beta_j x_{ij} + \varepsilon_i
$$ {#eq-liner-model}

is reformatted into:

$$\text{equation}$$
 {#eq-a-error-format}

The label {#eq-a-error-format} is placed on a new line with a leading space, making it unrecognizable to the Quarto cross-reference engine. Rendering the document produces:

Unable to resolve crossref @eq-a-error-format

Bug 2 — Lost syntax highlighting (gray background)

A correctly formatted single-line numbered equation:

$$(\hat{\alpha}, \hat{\boldsymbol{\beta}}) = \arg\min \left\{ \sum_{i=1}^{N} \left(y_i - \alpha - \sum_{j=1}^{p} \beta_j x_{ij}\right)^2 \right\} \quad \text{subject to} \quad \sum_{j=1}^{p} |\beta_j| \leq t$$ {#eq-lasso}

renders correctly and cross-references work, but the equation block itself is not wrapped in the usual gray background box. Moreover, any R code blocks that follow this equation also lose their gray background.

Expected behavior:

Switching between visual and source mode should preserve the original multi-line equation block structure.

The {#eq-label} syntax should remain on the same line as the closing $$.

All code blocks should consistently display the gray background regardless of preceding equation formatting.

I have checked https://github.com/posit-dev/positron/discussions/8684#discussion-8640338. It seems to be related to the issue I am experiencing, but it looks like it has not been properly fixed yet.

My Quarto version is 1.9.38 and my Positron version is 2026.07.0.

Attachments:

Image Image Image
Lingua principale
TypeScript
Stelle
652
Fork
64
Merge medio
8h 45m
PR unite (30g)
36

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 quarto-dev/quarto

Tutte le issue di quarto-dev/quarto

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.