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

Including a var shortcode within another var (nested var) triggers an error in 1.4, but not 1.3 #8464

Closed
lwjohnst86 opened this issue Jan 27, 2024 · 0 comments · Fixed by #8465
Assignees
Labels
backport bug Something isn't working
Milestone

Comments

@lwjohnst86
Copy link

lwjohnst86 commented Jan 27, 2024

Bug description

In 1.3, I used nested var shortcodes so I don't repeat myself. Now in 1.4, it no longer works. I also tested it in 1.5, the same thing is there.

Steps to reproduce

  1. Create a new book or website project (either with Quarto or RStudio).
  2. Don't change anything, except create a _variables.yml file.
  3. Add this in the new file:
keybind:
  palette: '{{< kbd linux=Ctrl-Shift-P mac=Cmd-Shift-P win=Ctrl-Shift-P >}}'
  test: "hi"
  git: '{{< kbd linux=Ctrl-Alt-M mac=Ctrl-Option-M win=Ctrl-Alt-M >}} or with the Palette ({{< var keybind.palette >}}, then type "commit")'
  1. Render the project. You don't even need to use the shortcode anywhere. There will be an error.
  2. Change the var keybind.palette to var keybind.test in the git section. Render the project. You will get an error now.

Expected behavior

Previously, it worked fine and rendered and did as I would expect, by inserting the {{< var keybind.git >}} it would produce the keybind for Git, plus the keybind for the Palette.

Actual behavior

Now I get this error:

FATAL (/opt/quarto/share/filters/main.lua:18151) An error occurred:
This is an internal error. Please file a bug report at https://github.com/quarto-dev/quarto-cli/
Error running filter /opt/quarto/share/filters/main.lua:
/opt/quarto/share/filters/main.lua:2232: attempt to call a nil value (global 'crash_with_stack_trace')
stack traceback:
	/opt/quarto/share/filters/main.lua:1820: in function 'fail'
	/opt/quarto/share/filters/main.lua:1825: in function 'internal_error'
	/opt/quarto/share/filters/main.lua:18151: in field 'render'
	/opt/quarto/share/filters/main.lua:842: in local 'filter_fn'
	/opt/quarto/share/filters/main.lua:302: in function </opt/quarto/share/filters/main.lua:292>
	(...tail calls...)
	[C]: in ?
	[C]: in method 'walk'
	/opt/quarto/share/filters/main.lua:224: in function </opt/quarto/share/filters/main.lua:214>
	(...tail calls...)
	/opt/quarto/share/filters/main.lua:936: in local 'callback'
	/opt/quarto/share/filters/main.lua:954: in upvalue 'run_emulated_filter_chain'
	/opt/quarto/share/filters/main.lua:990: in function </opt/quarto/share/filters/main.lua:987>
stack traceback:
	/opt/quarto/share/filters/main.lua:224: in function </opt/quarto/share/filters/main.lua:214>
	(...tail calls...)
	/opt/quarto/share/filters/main.lua:936: in local 'callback'
	/opt/quarto/share/filters/main.lua:954: in upvalue 'run_emulated_filter_chain'
	/opt/quarto/share/filters/main.lua:990: in function </opt/quarto/share/filters/main.lua:987>

Exited with status 1.

Your environment

  • Ubuntu 22.04
  • RStudio 2023.12.0 Build 369

Quarto check output

The output shows 1.5, but the same behaviour is seen in 1.4.

Quarto 1.5.4
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.11: OK
      Dart Sass version 1.69.5: OK
      Deno version 1.37.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.5.4
      Path: /opt/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (external install)
      Chromium: 869685

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /home/luke/.TinyTeX/bin/x86_64-linux
      Version: 2023

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

[✓] Checking Python 3 installation....OK
      Version: 3.10.12
      Path: /usr/bin/python3
      Jupyter: 5.5.0
      Kernels: python3

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

[✓] Checking R installation...........OK
      Version: 4.3.2
      Path: /usr/lib/R
      LibPaths:
        - /home/luke/R/x86_64-pc-linux-gnu-library/4.3
        - /usr/local/lib/R/site-library
        - /usr/lib/R/site-library
        - /usr/lib/R/library
      knitr: 1.45
      rmarkdown: 2.25

[✓] Checking Knitr engine render......OK
@lwjohnst86 lwjohnst86 added the bug Something isn't working label Jan 27, 2024
@cscheid cscheid self-assigned this Jan 27, 2024
@cscheid cscheid added this to the v1.5 milestone Jan 27, 2024
@cscheid cscheid modified the milestones: v1.5, Hot-fix Jan 27, 2024
@cscheid cscheid modified the milestones: Hot-fix, v1.5 Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants