Skip to content

Some callouts inherit from parent callout icon #11112

@mcanouil

Description

@mcanouil

Bug description

Callouts' icon gets inherited following this rule:

  • html: Important > Caution > Warning > Tip > Note
  • revealjs: Caution > Tip > Warning > Important > Note

It's worst for revealjs than html where top banner can also inherit the colour of the parent.

  • typst and latex are fine.

  • docx does not support nested callouts. (stack trace not pretty but informative)

    Stack trace
    FATAL (/Users/mcanouil/Projects/quarto/quarto-cli/src/resources/filters/./quarto-post/docx.lua:95) An error occurred:
    Found a nested callout in the document. Please fix this issue and try again.
    Error running filter /Users/mcanouil/Projects/quarto/quarto-cli/src/resources/filters/main.lua:
    ...quarto/quarto-cli/src/resources/filters/./common/log.lua:30: attempt to call a nil value (global 'crash_with_stack_trace')
    stack traceback:
            ...arto/quarto-cli/src/resources/filters/./common/error.lua:14: in function 'fail'
            .../quarto-cli/src/resources/filters/./quarto-post/docx.lua:95: in function <.../quarto-cli/src/resources/filters/./quarto-post/docx.lua:7>
            (...tail calls...)
            ...quarto/quarto-cli/src/resources/filters/./ast/render.lua:46: in local 'filter_fn'
            ...o/quarto-cli/src/resources/filters/./ast/customnodes.lua:154: in function <...o/quarto-cli/src/resources/filters/./ast/customnodes.lua:144>
            (...tail calls...)
            [C]: in ?
            [C]: in method 'walk'
            ...o/quarto-cli/src/resources/filters/./ast/customnodes.lua:76: in function <...o/quarto-cli/src/resources/filters/./ast/customnodes.lua:65>
            (...tail calls...)
            .../quarto-cli/src/resources/filters/./ast/runemulation.lua:82: in local 'callback'
            .../quarto-cli/src/resources/filters/./ast/runemulation.lua:100: in upvalue 'run_emulated_filter_chain'
            .../quarto-cli/src/resources/filters/./ast/runemulation.lua:136: in function <.../quarto-cli/src/resources/filters/./ast/runemulation.lua:133>
    stack traceback:
            ...o/quarto-cli/src/resources/filters/./ast/customnodes.lua:76: in function <...o/quarto-cli/src/resources/filters/./ast/customnodes.lua:65>
            (...tail calls...)
            .../quarto-cli/src/resources/filters/./ast/runemulation.lua:82: in local 'callback'
            .../quarto-cli/src/resources/filters/./ast/runemulation.lua:100: in upvalue 'run_emulated_filter_chain'
            .../quarto-cli/src/resources/filters/./ast/runemulation.lua:136: in function <.../quarto-cli/src/resources/filters/./ast/runemulation.lua:133>
    ERROR: Error
        at renderFiles (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/render/render-files.ts:350:23)
        at eventLoopTick (ext:core/01_core.js:175:7)
        at async render (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/render/render-shared.ts:102:18)
        at async renderForPreview (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/preview/preview.ts:428:24)
        at async render (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/preview/preview.ts:172:22)
        at async preview (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/preview/preview.ts:189:18)
        at async Command.actionHandler (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/preview/cmd.ts:424:7)
        at async Command.execute (https://deno.land/x/[email protected]/command/command.ts:1948:7)
        at async Command.parseCommand (https://deno.land/x/[email protected]/command/command.ts:1780:14)
        at async quarto (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/quarto.ts:156:5)
  • pptx does not support callouts.

Same result for: 1.6, 1.5, and 1.4

Screenshots
html revealjs
Image Image
Image Image
Image Image
Image Image
Image Image

Steps to reproduce

Quarto document
---
title: "Callouts"
format:
  html: default
  revealjs: default
---

## Important

:::: {.callout-important}

::: {.callout-tip}
- HTML: Yes
- Reveal.js: No
:::

::: {.callout-note}
- HTML: Yes
- Reveal.js: Yes + banner colour
:::

::: {.callout-warning}
- HTML: Yes
- Reveal.js: No
:::

::: {.callout-caution}
- HTML: Yes
- Reveal.js: No
:::
::::

## Caution

:::: {.callout-caution}
::: {.callout-tip}
- HTML: Yes
- Reveal.js: Yes + banner colour
:::

::: {.callout-note}
- HTML: Yes
- Reveal.js: Yes + banner colour
:::

::: {.callout-warning}
- HTML: Yes
- Reveal.js: Yes + banner colour
:::

::: {.callout-important}
- HTML: No
- Reveal.js: Yes + banner colour
:::
::::

## Warning

:::: {.callout-warning}

::: {.callout-tip}
- HTML: Yes
- Reveal.js: No
:::

::: {.callout-note}
- HTML: Yes
- Reveal.js: Yes + banner colour
:::

::: {.callout-important}
- HTML: No
- Reveal.js: Yes + banner colour
:::

::: {.callout-caution}
- HTML: No
- Reveal.js: No
:::
::::

## Tip

:::: {.callout-tip}
::: {.callout-note}
- HTML: Yes
- Reveal.js: Yes + banner colour
:::

::: {.callout-important}
- HTML: No
- Reveal.js: Yes + banner colour
:::

::: {.callout-warning}
- HTML: No
- Reveal.js: Yes + banner colour
:::

::: {.callout-caution}
- HTML: No
- Reveal.js: No
:::
::::

## Note

:::: {.callout-note}
::: {.callout-important}
- HTML: No
- Reveal.js: No
:::

::: {.callout-tip}
- HTML: No
- Reveal.js: No
:::

::: {.callout-warning}
- HTML: No
- Reveal.js: No
:::

::: {.callout-caution}
- HTML: No
- Reveal.js: No
:::
::::

Expected behaviour

Parent callout should not matter.

Actual behaviour

Parent matters.

Quarto check output

Full
Quarto 99.9.9
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.4.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.46.3: OK
      Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 99.9.9
      commit: 9d866bd7b142f004a3a32d3b71e1a4da8c9b97af
      Path: /Users/mcanouil/Projects/quarto/quarto-cli/package/dist/bin

[✓] Checking tools....................OK
      TinyTeX: v2024.07.03
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/mcanouil/Library/TinyTeX/bin/universal-darwin
      Version: 2024

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

[✓] Checking Python 3 installation....OK
      Version: 3.13.0
      Path: /Users/mcanouil/Projects/quarto/quarto-playground/.venv/bin/python3
      Jupyter: 5.7.2
      Kernels: julia-1.10, python3

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

(/) Checking R installation...........ℹ R version 4.4.1 (2024-06-14)
! Config '~/.Rprofile' was loaded!
[✓] Checking R installation...........OK
      Version: 4.4.1
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Users/mcanouil/Projects/quarto/quarto-playground/renv/library/macos/R-4.4/aarch64-apple-darwin20
        - /Users/mcanouil/Library/Caches/org.R-project.R/R/renv/sandbox/macos/R-4.4/aarch64-apple-darwin20/f7156815
      knitr: 1.48
      rmarkdown: 2.27

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    calloutsIssues with Callout Blocks.enhancementNew feature or requestlintlinting-related issues

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions