qmd-syntax-helper: Pandoc-based rules lose reference links and footnotes that depend on the rest of the document
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 77/100
- Tipo de issue
- Documentación
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- markdown, rust
- Área
- documentation, tooling
Línea de trabajo
La incidencia propone una advertencia en la guía de migración y una advertencia opcional para las secuencias de corchetes escapados en la salida de qmd-syntax-helper; no menciona archivos ni pruebas. Empieza por localizar la guía de migración y el procesamiento de la salida del helper; después, comprueba cómo sus reglas informan de los resultados de la conversión. El trabajo estará terminado cuando la guía explique que hay que convertir las referencias y las notas al pie dentro de los bloques afectados antes de la conversión, y la salida pueda señalar los corchetes escapados para su revisión.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 321
- Forks
- 23
- Merge medio
- 11 h 39 min
- PR fusionados (30 d)
- 251
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de quarto-dev/q2
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
quarto-dev/q2#1446 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
quarto-dev/q2#1095 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
quarto-dev/q2#1448 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
quarto-dev/q2#1447 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
quarto-dev/q2#1444 ·
Los mantenedores suelen responder en 1 día
Todos los issues de quarto-dev/q2
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ProvableHQ/snarkOS#4817 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
facebookexperimental/reverie#193 ·
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
pbakaus/impeccable#1748 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
farion1231/cc-switch#10196 ·
Los mantenedores suelen responder en 1 día