Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Revealjs: code block at the end of a callout lost its bottom spacing since 1.8.15

Ouverte Adaptée aux débutants
#15,014 0 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
72/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
html, scss
Domaine
frontend

Piste de recherche

Les deux règles se trouvent dans src/resources/formats/revealjs/quarto.scss, aux alentours des lignes 919-926 et 975-977, et elles ciblent un dernier div.sourceCode mais pas l'enveloppe div.code-copy-outer-scaffold ajoutée par le post-traitement HTML (voir src/format/reveal/format-reveal.ts vers la ligne 260). Générez une présentation revealjs avec un callout qui se termine par un bloc de code, puis vérifiez dans le navigateur l'espace sous le code. C'est terminé lorsque les deux sélecteurs ciblent aussi le scaffold comme dernier enfant et que l'espacement correspond à celui de la 1.7.34 pour les deux types de callout.

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

Description

bug callouts regression revealjs

In Revealjs, when a code block is the last element of a callout, it now sits against the bottom of the callout. With appearance="simple" and no title, the code block border touches the callout border.

Gap between the bottom of the code block and the bottom of the callout, measured with Chromium on the example below:

Callout 1.7.34 main
Default, titled, ending with code 12.03px 8.33px
Simple, untitled, ending with code 15.74px 0.93px

The 0.93px is only the 1px callout border. Callouts ending with a paragraph render the same in both versions.

#13024 is first released in 1.8.15, so I expect the change to start there. I only rendered with 1.7.34 and main, not with 1.8.14 or 1.8.15.

Reproducible example

---
title: Callout last child code
format: revealjs
---

## Titled ending with code

::: {.callout-note}
## Titled

Some text.

```python
x = 1
```
:::

## Simple untitled ending with code

::: {.callout-note appearance="simple"}
Some text.

```python
x = 1
```
:::

What happens

Since #13024, the HTML postprocessor wraps code blocks in a div.code-copy-outer-scaffold for the copy button. Revealjs uses the same postprocessor with copyCode: true:

https://github.com/quarto-dev/quarto-cli/blob/e63ace9e50f55dd3ab3152d068738ed44a0987d0/src/format/reveal/format-reveal.ts#L260

So the last child of .callout-content is now the scaffold div and not div.sourceCode. Two rules added in #11251 to handle a code block in last position no longer match.

For simple untitled callouts, #11251 added a margin below a last div.sourceCode so that the code border does not merge with the callout border. This rule never matches now, which is the visible part:

https://github.com/quarto-dev/quarto-cli/blob/e63ace9e50f55dd3ab3152d068738ed44a0987d0/src/resources/formats/revealjs/quarto.scss#L975-L977

For titled callouts, the last child gets padding-bottom: 0.5rem and no margin, except when it is a div.sourceCode, which keeps the var(--r-block-margin) margin. This exclusion was there to avoid the duplicated background color on a code block in last position. The scaffold is not excluded, so it gets the 8px padding instead of the 12px margin. This one is more cosmetic.

https://github.com/quarto-dev/quarto-cli/blob/e63ace9e50f55dd3ab3152d068738ed44a0987d0/src/resources/formats/revealjs/quarto.scss#L919-L926

We could make both selectors also target div.code-copy-outer-scaffold when it is the last child.

Related: #13446 and #13238 are about the same scaffold change on HTML callouts, which use different rules in the Bootstrap stylesheets.

Langage dominant
JavaScript
Étoiles
6.1k
Forks
463
Merge moyen
21 h 53 min
PR mergées (30 j)
58

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.