DOCX: callouts end with an empty paragraph, also when not needed

Ouverte Adaptée aux débutants
#15,394 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
81/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
javascript
Domaine
documentation

Piste de recherche

Lisez src/resources/filters/quarto-post/docx.lua autour des lignes 101–107, où l’issue indique que le paragraphe vide est ajouté inconditionnellement. Comparez le contenu d’un callout qui se termine par un paragraphe à celui qui se termine par un tableau. Effectuez ensuite le rendu de l’exemple DOCX fourni et examinez word/document.xml. Le travail est terminé lorsque le paragraphe supplémentaire apparaît uniquement lorsqu’il est nécessaire après un contenu qui ne se termine pas déjà par un paragraphe.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

bug callouts docx regression
I have:
  • searched the issue tracker for similar issues
  • installed the latest version of Quarto CLI
  • formatted my issue following the Bug Reports guide
Bug description

In DOCX output, callout boxes with the default appearance always end with an empty paragraph <w:p/> after their content. In LibreOffice Writer, it shows as an unnecessary empty line at the end of every such callout. (I don't have Word to check whether it shows the empty line there as well; it would be great if someone could confirm.)

The empty paragraph was added in #12642 (port of #8392, fixing #6357), because a table cell must end with a paragraph, e.g., when the callout content ends with a table.
However, it's added unconditionally:
https://github.com/quarto-dev/quarto-cli/blob/cda41021442b20964e10e265b9dcdf81f490c18e/src/resources/filters/quarto-post/docx.lua#L101-L107

Callouts with appearance="simple" or "minimal" are not affected.
The issue persists with the latest pre-release 1.12.3.

I investigated this with the help of an AI assistant, grounded in the Quarto source; I verified the findings myself.

Steps to reproduce

Create a source doc with DOCX output and a callout box:

---
format: docx
---

::: {.callout-note}
This is a callout.
:::

Run quarto render, and open the DOCX, e.g., in LibreOffice Writer.

Actual behavior

The callout's body cell in word/document.xml ends with an empty paragraph (abridged):

<w:tc>
  <w:tcPr>...</w:tcPr>
  <w:p>
    ...
    <w:r>
      <w:t xml:space="preserve">This is a callout.</w:t>
    </w:r>
  </w:p>
  <w:p/>
</w:tc>

Here an annotated screenshot from LibreOffice:

Screenshot of Quarto's docx file in LibreOffice. It shows a textbox with an additional empty space, and a sad emoji is drawn by hand next to it.
Expected behavior

The empty paragraph is only added when the callout content does not already end with a paragraph, e.g., when it ends with a table.

Your environment
  • IDE: none, quarto render on the command line
  • OS: Ubuntu Linux, kernel 7.0.0-43
  • LibreOffice Writer 24.2.7.2
Quarto check output
$ quarto check
Quarto 1.11.9
[✓] Checking environment information...
      Quarto cache location: /home/$USER/.cache/quarto
      Project root: /home/$USER/
      Project config: /home/$USER/_quarto.yml
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.10.0: OK
      Dart Sass version 1.101.0: OK
      Deno version 2.9.8: OK
      Typst version 0.15.1: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.11.9
      Path: /opt/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: v2026.04
      Chrome Headless Shell: (not installed)
      VeraPDF: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /home/$USER/.TinyTeX/bin/x86_64-linux
      Version: 2026

[✓] Checking Chrome Headless....................OK
      Using: Chrome found on system
      Path: /usr/bin/google-chrome
      Source: PATH

[✓] Checking basic markdown render....OK

[✓] Checking R installation...........OK
      Version: 4.4.3
      Path: /home/$USER/apps/miniforge3/lib/R
      LibPaths:
        - /home/$USER/apps/miniforge3/lib/R/library
      knitr: 1.50
      rmarkdown: 2.29

[✓] Checking Knitr engine render......OK

[✓] Checking Python 3 installation....OK
      Version: 3.12.11 (Conda)
      Path: /home/$USER/apps/miniforge3/bin/python
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with conda install jupyter

[✓] Checking Julia installation...
Langage dominant
JavaScript
Étoiles
6.2k
Forks
492
Merge moyen
15 h 15 min
PR mergées (30 j)
94

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de quarto-dev/quarto-cli

Toutes les issues de quarto-dev/quarto-cli

Issues similaires

Plus d'issues JavaScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.