Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross-reference div syntax causing Lua filter error with GFM format #10858

Closed
sun123zxy opened this issue Sep 22, 2024 · 3 comments · Fixed by #10865
Closed

Cross-reference div syntax causing Lua filter error with GFM format #10858

sun123zxy opened this issue Sep 22, 2024 · 3 comments · Fixed by #10865
Assignees
Labels
bug Something isn't working crossref
Milestone

Comments

@sun123zxy
Copy link
Contributor

sun123zxy commented Sep 22, 2024

Bug description

Lua filter error mentioned in #10358 still exists if cross-reference div syntax is used. Here's a minimal example:

---
title: "Test"
format: gfm
---

::: {#fig-line-plot}

```{python}
import matplotlib.pyplot as plt
plt.plot([1,23,2,4])
plt.show()
```

A line plot
:::

Tested on

  • Quarto 1.5.57, Windows 11

gives the following error:

Error running filter C:\Program Files\Quarto\share\filters\main.lua:
Block, list of Blocks, or compatible element expected, got table
        while retrieving function argument blocks
        while retrieving arguments for function Blocks
stack traceback:
        C:\Program Files\Quarto\share\filters\main.lua:22474: in field 'render'
        C:\Program Files\Quarto\share\filters\main.lua:1233: in local 'filter_fn'
        C:\Program Files\Quarto\share\filters\main.lua:635: in function <C:\Program Files\Quarto\share\filters\main.lua:625>
        (...tail calls...)
        [C]: in ?
        [C]: in method 'walk'
        C:\Program Files\Quarto\share\filters\main.lua:557: in function <C:\Program Files\Quarto\share\filters\main.lua:546>
        (...tail calls...)
        C:\Program Files\Quarto\share\filters\main.lua:1334: in local 'callback'
        C:\Program Files\Quarto\share\filters\main.lua:1352: in upvalue 'run_emulated_filter_chain'
        C:\Program Files\Quarto\share\filters\main.lua:1388: in function <C:\Program Files\Quarto\share\filters\main.lua:1385>
stack traceback:
        C:\Program Files\Quarto\share\filters\main.lua:557: in function <C:\Program Files\Quarto\share\filters\main.lua:546>
        (...tail calls...)
        C:\Program Files\Quarto\share\filters\main.lua:1334: in local 'callback'
        C:\Program Files\Quarto\share\filters\main.lua:1352: in upvalue 'run_emulated_filter_chain'
        C:\Program Files\Quarto\share\filters\main.lua:1388: in function <C:\Program Files\Quarto\share\filters\main.lua:1385>

Also tested on

  • Quarto 1.5.57, arm64 Ubuntu via WSL

results in similar error.

Quarto check output

Quarto 1.5.57
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.2.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.41.0: OK
      Typst version 0.11.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.5.57
      Path: C:\Program Files\Quarto\bin
      CodePage: 936

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

[>] Checking LaTeX....................OK
      Using: TinyTex
      Path: C:\Users\sun123zxy\AppData\Roaming\TinyTeX\bin\windows\
      Version: 2024

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

[>] Checking Python 3 installation....OK
      Version: 3.12.4 (Conda)
      Path: C:/Users/sun123zxy/.conda/envs/main/python.exe
      Jupyter: 5.7.2
      Kernels: python3

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

[>] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/
@sun123zxy sun123zxy added the bug Something isn't working label Sep 22, 2024
@cscheid cscheid self-assigned this Sep 23, 2024
@cscheid cscheid modified the milestones: v1.5, v1.6 Sep 23, 2024
@cscheid
Copy link
Collaborator

cscheid commented Sep 23, 2024

Thanks, I can repro on main as well. We'll fix right away.

@cscheid
Copy link
Collaborator

cscheid commented Sep 23, 2024

As a workaround, adding #| echo: false will get you unblocked.

@cscheid
Copy link
Collaborator

cscheid commented Sep 23, 2024

This is not the same bug as #10358; the bug here is that in div syntax, the echoing output of the code block itself lives inside the div, and so we have a float with that is a Blocks value instead of a single Block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working crossref
Projects
None yet
2 participants