Comment spans render as body text in every format but docx
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- html, javascript
- Área
- backend, documentation
Línea de trabajo
The report identifies Pandoc’s writers as the source of inlining and duplicate identifiers, and points to Quarto’s HTML theming, Typst template, and filters for possible handling. First compare the plain Pandoc output with Quarto rendering, then trace the relevant Quarto filters and templates. Done means comment text is not emitted as prose in non-docx output, with annotations or safe omission handled for the affected formats.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
Pandoc represents a Word comment as a pair of spans: .comment-start,
whose content is the note, and .comment-end, with a shared id. This
is pandoc's own vocabulary rather than something a user invented — its
docx reader produces exactly this from a commented .docx
(--track-changes=all), and its docx writer consumes it, so comments
round-trip through markdown.
Rendering the same document to any other format puts the note into the
document as ordinary prose.
Reproduction
comment.qmd:
---
title: "Comment probe"
---
The exposure window was [CONFIRM: that this is the window the
pharmacology supports.]{.comment-start id="0" author="Reviewer"}days 1
to 14[]{.comment-end id="0"}.
quarto render comment.qmd --to docx
quarto render comment.qmd --to html
quarto render comment.qmd --to typst
- docx — correct. A real Word comment from "Reviewer", anchored to
"days 1 to 14". Confirmed by readingword/comments.xmland
independently in LibreOffice, which shows three of three as ranged
annotations in a longer document. - html — the note is visible body text:
<span id="0" class="comment-start" data-author="Reviewer">CONFIRM: …</span>days 1 to 14<span id="0" class="comment-end"></span> - typst — the class is gone and the note is body text:
The exposure window was CONFIRM: …<0>days 1 to 14<0>. - pdf, through typst —
pdftotextfinds the note set in the middle
of the sentence, which is what a reader sees.
Why this is worth changing
The failure is silent. A plan rendered for Word carries reviewer notes
in the margin, and the same source rendered to HTML or PDF asserts them
as things the document says. "CONFIRM: that this is the window the
pharmacology supports" reads, in the PDF, as part of the methods.
For a regulatory document that is the difference between a note to a
reviewer and a statement to an agency, so the current behaviour is one
a user cannot safely leave to chance: it has to be worked around by not
emitting comments for those formats at all, which is what we now do.
What would be better, cheapest first
-
Do not inline the note. In a format with nowhere to put an
annotation, dropping the.comment-startspan's content and keeping
the text it was attached to is strictly better than printing it. A
dropped note is a known limitation; a printed one is a defect in the
document. -
Render a real annotation where the format has one. HTML needs no
pandoc change at all: the class anddata-author/data-datealready
reach the output, so Quarto could present it as a margin note or an
aside, in the same places.column-margincontent goes, or at least
style it as an annotation rather than prose. Typst has no comment, but
a margin note is idiomatic there too. -
The shared
idbecomes a duplicate identifier. Both spans of a
pair must carry the sameidfor the docx writer, and pandoc treats
anidattribute as the element's identifier. So HTML gets two
elements withid="0", which is invalid, and typst gets the label
<0>twice, which makes a label ambiguous. This is worth fixing even
if the annotation feature is not taken up.
Which part is pandoc's
Running plain pandoc -f markdown -t html and -t typst on the same
input gives the same output, so the inlining and the duplicate
identifier come from pandoc's writers rather than from Quarto's
filters. Items 1 and 3 may well belong upstream.
Item 2 is Quarto's either way, since the HTML theming and the typst
template are Quarto's — and a Quarto filter could cover all three for
Quarto's formats without waiting on pandoc, which is why this is filed
here.
Versions
Quarto 1.9.37, bundled pandoc 3.8.3, Windows 11. Also reproduced with
standalone pandoc 3.9.
- Lenguaje dominante
- JavaScript
- Estrellas
- 6.2k
- Forks
- 482
- Merge medio
- 17 h 46 min
- PR fusionados (30 d)
- 135
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una 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/quarto-cli
-
Listing category filter and URL hash disagree after Back, or with `&`, `=` or `%` in a categoryAbiertobug listings
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
quarto-dev/quarto-cli#15340 ·
Los mantenedores suelen responder en 1 día
-
brand bug typst
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
quarto-dev/quarto-cli#15311 ·
Los mantenedores suelen responder en 1 día
-
Notebook preview header title takes the heading colour on the primary backgroundPosiblemente ocupada @SabyaXSachi la tomó hace 5 días. Abiertoaccessibility bug embed
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
quarto-dev/quarto-cli#15306 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bootstrap bug themes
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
quarto-dev/quarto-cli#15304 ·
Los mantenedores suelen responder en 1 día
-
accessibility bug code-blocks html themes
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
quarto-dev/quarto-cli#15303 ·
Los mantenedores suelen responder en 1 día
Todos los issues de quarto-dev/quarto-cli
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
0. Needs triage bug feature: api
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
agent-os ai bug good first issue help wanted
Dificultad 1/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
area: documentation good first issue package: rule-data status: accepting prs
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
status: needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
mastra-ai/mastra#30109 · 2 comentarios ·
Los mantenedores suelen responder en 1 día