qmd-syntax-helper: Pandoc-based rules lose reference links and footnotes that depend on the rest of the document
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
- 77/100
- Tipo di issue
- Documentazione
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- markdown, rust
- Ambito
- documentation, tooling
Direzione di ricerca
La issue propone un avviso nella guida alla migrazione e un avviso facoltativo per le sequenze di parentesi quadre con escape nell’output di qmd-syntax-helper; non indica file né test. Inizia individuando la guida alla migrazione e la gestione dell’output dell’helper, poi verifica come le sue regole segnalano i risultati della conversione. Il lavoro è completato quando la guida spiega che i riferimenti e le note a piè di pagina all’interno dei blocchi interessati vanno convertiti prima della conversione e l’output può segnalare le parentesi quadre con escape da esaminare.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Some qmd-syntax-helper rules (definition-lists, and grid-tables when it produces list tables) pass the construct they convert through Pandoc and write it back from Pandoc's AST. Pandoc only sees the construct itself, not the rest of the document. Markup inside it that depends on something elsewhere in the document therefore cannot be resolved: reference-style links and their [label]: url definitions, and footnote references with their [^n]: ... definitions. That markup is written back as escaped literal text (\[the manual\]\[docs\], \[\^1\]), and the link or footnote is silently lost.
Running the rules in the other order does not help. Before conversion, q2 reads a Pandoc definition list as literal text, so the reference-links rule cannot see uses inside it. It then treats their definitions as unused and removes them. Either way, the URL for a reference link inside a definition list disappears from the document. It can only be recovered from version control. I don't think this can be prevented in general: the construct has to be converted before its contents are visible to q2, and converting it is what strips the context. But the migration guide should warn about it. The helper could also flag its own output when it contains escaped \]\[ or \[\^ sequences, so these cases get a manual look.
Example
Some prose with a [working link][docs].
Term
: A definition that cites [the manual][docs]
and has a footnote[^1].
[docs]: https://example.com/docs
[^1]: The footnote text.
Pandoc renders both links and the footnote. After qmd-syntax-helper convert -r definition-lists -i:
Some prose with a [working link][docs].
::: {.definition-list}
* Term
* A definition that cites \[the manual\]\[docs\]
and has a footnote\[\^1\].
:::
[docs]: https://example.com/docs
[^1]: The footnote text.
and then after -r reference-links:
Some prose with a [working link](https://example.com/docs).
::: {.definition-list}
* Term
* A definition that cites \[the manual\]\[docs\]
and has a footnote\[\^1\].
:::
[^1]: The footnote text.
The link inside the definition is now literal text, and its URL is gone. The footnote reference is literal and its definition is orphaned. Running reference-links first and definition-lists second ends in the same state: the use inside the definition list is not seen, so [docs]: is removed in the first step.
A suggested sentence for the migration guide: before converting definition lists or grid tables, convert any reference-style links and footnotes inside them to inline form by hand ([text](url), ^[note]). Afterwards, review the converted blocks for escaped brackets.
qmd-syntax-helper 0.1.0, pandoc 3.13.
- Lingua principale
- Rust
- Stelle
- 321
- Fork
- 23
- Merge medio
- 11h 39m
- PR unite (30g)
- 251
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di quarto-dev/q2
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
quarto-dev/q2#1446 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
quarto-dev/q2#1095 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
quarto-dev/q2#1448 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
quarto-dev/q2#1447 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
quarto-dev/q2#1444 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di quarto-dev/q2
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ProvableHQ/snarkOS#4817 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
facebookexperimental/reverie#193 ·
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
pbakaus/impeccable#1748 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
farion1231/cc-switch#10196 ·
I maintainer di solito rispondono entro 1 giorno