diff --git a/news/changelog-1.8.md b/news/changelog-1.8.md index 4cc7ab8cf09..aa395cf791a 100644 --- a/news/changelog-1.8.md +++ b/news/changelog-1.8.md @@ -35,3 +35,7 @@ All changes included in 1.8: ## Crossrefs - ([#12615](https://github.com/quarto-dev/quarto-cli/pull/12615)): Adds `algorithm` to theorem environments. (author: @jeremy9959) + +## Lua Filters + +- ([#12727](https://github.com/quarto-dev/quarto-cli/issues/12727)): Do not crash in the presence of malformed tabset contents. \ No newline at end of file diff --git a/src/resources/filters/customnodes/panel-tabset.lua b/src/resources/filters/customnodes/panel-tabset.lua index 38efc35d617..03b208fb88a 100644 --- a/src/resources/filters/customnodes/panel-tabset.lua +++ b/src/resources/filters/customnodes/panel-tabset.lua @@ -146,6 +146,10 @@ _quarto.ast.add_handler({ constructor = function(params) local node = _quarto.ast.create_custom_node_scaffold("Tabset", "Block") + if params.tabs == nil then + warn("No tabs found in tabset. Please check that your markdown includes tab headings as appropriate.") + params.tabs = pandoc.List() + end local custom_data = { __quarto_custom_node = node, diff --git a/tests/docs/smoke-all/2025/05/13/issue-12727.qmd b/tests/docs/smoke-all/2025/05/13/issue-12727.qmd new file mode 100644 index 00000000000..12a48b467e7 --- /dev/null +++ b/tests/docs/smoke-all/2025/05/13/issue-12727.qmd @@ -0,0 +1,35 @@ +--- +title: "Geographic data analysis in R and Python: comparing code and outputs for vector data" +--- + +::: {.panel-tabset group="language"} + +## Python + +```python +print("ok") +``` + +## R + +```r +print("hello") +``` + +::: + +::: {.panel-tabset group="language"} + +## Python + +```python +print("Missing the headers here but we shouldn't crash") +``` + +## R + +```r +cat("hello") +``` + +:::