-
Notifications
You must be signed in to change notification settings - Fork 394
Description
Bug description
A confusing error (especially in a large document), if
#| tbl-cap: '' i.e. it is an empty string inside apostrophes or quotation marks.
Steps to reproduce
---
title: "Untitled"
format: html
---
This is @tbl-t1.
```{r}
#| label: tbl-t1
#| tbl-cap: ''
gt::gt(mtcars)
```Expected behavior
If removing the apostrophes, a more informative error is displayed (Field "tbl-cap" has empty value but it must instead be a string 9: #| label: tbl-t1 10: #| tbl-cap: ~).
Though I think I would prefer a more lazy/liberal approach of allowing all such empty strings for situations where higher-level functions produce ready-made tables/figures which for some happen to contain empty captions. In that case the end-user could easily insert it manually without a priori remembering how exactly the #| tbl-cap was meant to be spelled.
Actual behavior
Error running filter C:/PROGRA~1/Quarto/share/filters/main.lua: C:/PROGRA~1/Quarto/share/filters/main.lua:2182: attempt to index a nil value (field 'integer index') stack traceback: C:/PROGRA~1/Quarto/share/filters/main.lua:12782: in function 'table_captionsAndLabels' C:/PROGRA~1/Quarto/share/filters/main.lua:12745: in function <C:/PROGRA~1/Quarto/share/filters/main.lua:12714> (...tail calls...) [C]: in ? [C]: in method 'walk' C:/PROGRA~1/Quarto/share/filters/main.lua:178: in function 'run_emulated_filter' C:/PROGRA~1/Quarto/share/filters/main.lua:566: in local 'callback' C:/PROGRA~1/Quarto/share/filters/main.lua:577: in upvalue 'run_emulated_filter_chain' C:/PROGRA~1/Quarto/share/filters/main.lua:610: in function <C:/PROGRA~1/Quarto/share/filters/main.lua:607> stack traceback: C:/PROGRA~1/Quarto/share/filters/main.lua:178: in function 'run_emulated_filter' C:/PROGRA~1/Quarto/share/filters/main.lua:566: in local 'callback' C:/PROGRA~1/Quarto/share/filters/main.lua:577: in upvalue 'run_emulated_filter_chain' C:/PROGRA~1/Quarto/share/filters/main.lua:610: in function <C:/PROGRA~1/Quarto/share/filters/main.lua:607>
Your environment
- IDE: RStudio 2023.06.01 Build 524
- R: 4.3.1
- Quarto 1.4.156
- Windows 11
Quarto check output
[>] Checking versions of quarto binary dependencies...
Pandoc version 3.1.2: OK
Dart Sass version 1.55.0: OK
Deno version 1.33.2: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
Version: 1.4.156
Path: C:\Program Files\Quarto\bin
CodePage: unknown
[>] Checking basic markdown render....OK
[>] Checking Python 3 installation....OK
Version: 3.11.4
Path: C:/Users/py128/AppData/Local/Programs/Python/Python311/python.exe
Jupyter: (None)
Jupyter is not available in this Python installation.
Install with py -m pip install jupyter
[>] Checking R installation...........OK
Version: 4.3.1
Path: C:/PROGRA1/R/R-431.1
LibPaths:
- C:/Users/py128/AppData/Local/R/win-library
- C:/Program Files/R/R-4.3.1/library
knitr: 1.43
rmarkdown: 2.23
[>] Checking Knitr engine render......OK