Skip to content

Flakiness with include and nested code blocks #13977

@aoanla

Description

@aoanla

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

There's some weird flakiness with {{< include >}} and nested code blocks, which I can't find a simple reproducer for.

In a fairly complex document, I have the setup

index.qmd
-has the header info and some introductory content
{{< include L2_3.qmd >}}

L2_3.qmd
- has a lot more content, including nested callouts, some of which also include syntax highlighted code blocks (but not executed code because that doesn't work inside callouts)

quarto preview can happily render HTML previews of L2_3.qmd by itself, correctly rendering the nested callouts and code blocks.

However, if I try to to use quarto preview to render an HTML preview of index.qmd, it fails when it tries to parse the include, with the error:

FATAL (/opt/quarto-1.8.27/share/filters/main.lua:4423) An error occurred:
Found a nested callout in the document. Please fix this issue and try again.
Error running filter /opt/quarto-1.8.27/share/filters/main.lua:
/opt/quarto-1.8.27/share/filters/main.lua:1213: FATAL QUARTO ERROR
stack traceback:
/opt/quarto-1.8.27/share/filters/main.lua:2619: in function 'fatal'
/opt/quarto-1.8.27/share/filters/main.lua:2199: in function 'fail'
/opt/quarto-1.8.27/share/filters/main.lua:4423: in function </opt/quarto-1.8.27/share/filters/main.lua:4336>
(...tail calls...)
/opt/quarto-1.8.27/share/filters/main.lua:1213: in local 'filter_fn'
/opt/quarto-1.8.27/share/filters/main.lua:653: in function </opt/quarto-1.8.27/share/filters/main.lua:643>
(...tail calls...)
....8.27/share/pandoc/datadir/../../filters/modules/jog.lua:34: in upvalue 'run_filter_function'
....8.27/share/pandoc/datadir/../../filters/modules/jog.lua:223: in function <....8.27/share/pandoc/datadir/../../filters/modules/jog.lua:202>
(...tail calls...)
[C]: in function 'pandoc.List.map'
....8.27/share/pandoc/datadir/../../filters/modules/jog.lua:125: in upvalue 'recurse'
....8.27/share/pandoc/datadir/../../filters/modules/jog.lua:222: in local 'jogger'
....8.27/share/pandoc/datadir/../../filters/modules/jog.lua:171: in upvalue 'recurse'
....8.27/share/pandoc/datadir/../../filters/modules/jog.lua:222: in function <....8.27/share/pandoc/datadir/../../filters/modules/jog.lua:202>
(...tail calls...)
/opt/quarto-1.8.27/share/filters/main.lua:572: in function </opt/quarto-1.8.27/share/filters/main.lua:550>
(...tail calls...)
/opt/quarto-1.8.27/share/filters/main.lua:1314: in local 'callback'
/opt/quarto-1.8.27/share/filters/main.lua:1332: in upvalue 'run_emulated_filter_chain'
/opt/quarto-1.8.27/share/filters/main.lua:1368: in function </opt/quarto-1.8.27/share/filters/main.lua:1365>
WARN: Error encountered when rendering files

Now, this error isn't very helpful - nested callouts do work, so I'm not sure how I'm supposed to "fix" the problem that suddenly they fail in imported documents.

I've tried to reproduce this with chunks of the included document - including parts with the most complex nesting of callouts and syntax highlighted code blocks - and I can't get it to fail in the same way.

Steps to reproduce

I don't know how to reproduce this bug in a minimal way.

Actual behavior

No response

Expected behavior

No response

Your environment

Fedora 42
VSCodium
Quarto 1.8.27

Quarto check output

Quarto 1.8.27
[✓] Checking environment information...
Quarto cache location: /home/aoanla/.cache/quarto
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.6.3: OK
Dart Sass version 1.87.0: OK
Deno version 2.3.1: OK
Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.8.27
Path: /opt/quarto-1.8.27/bin

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

[✓] Checking LaTeX....................OK
Using: Installation From Path
Path: /usr/bin
Version: 2023

[✓] Checking Chrome Headless....................OK
Chrome: (not detected)

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

[✓] Checking Python 3 installation....OK
Version: 3.13.11
Path: /home/aoanla/P2T2026/.venv/bin/python
Jupyter: 5.9.1
Kernels: python3, julia-1.11, julia-1.12

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

[✓] Checking R installation...........OK
Version: 4.5.2
Path: /usr/lib64/R
LibPaths:
- /home/aoanla/R/x86_64-redhat-linux-gnu-library/4.5
- /usr/lib64/R/library
- /usr/share/R/library
knitr: 1.51
rmarkdown: 2.30

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-reproIssues that are blocked until reporter provides an adequate reproduction

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions