quarto-dev / quarto-dev/quarto-cli

Some callouts inherit from parent callout icon

Open
#11,112 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

callouts enhancement lint
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

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/cliffy@v1.0.0-rc.3/command/command.ts:1948:7)
        at async Command.parseCommand (https://deno.land/x/cliffy@v1.0.0-rc.3/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
  • Version: 99.9.9
  • commit: 9d866bd7b142f004a3a32d3b71e1a4da8c9b97af
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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no implementation file or regression test. Start by rendering the supplied QMD reproducer in html and revealjs, then trace the callout rendering entry points and add coverage for nested callouts. Done means each child keeps its own icon and revealjs banner color regardless of the parent callout.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.