Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/changelog-1.9.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ All changes included in 1.9:
- ([#13402](https://github.com/quarto-dev/quarto-cli/issues/13402)): `nfpm` (<https://nfpm.goreleaser.com/>) is now used to create the `.deb` package, and new `.rpm` package. Both Linux packages are also now built for `x86_64` (`amd64`) and `aarch64` (`arm64`) architectures.
- ([#13528](https://github.com/quarto-dev/quarto-cli/pull/13528)): Adds support for table specification using nested lists and the `list-table` class.
- ([#13575](https://github.com/quarto-dev/quarto-cli/pull/13575)): Improve CPU architecture detection/reporting in macOS to allow quarto to run in virtualized environments such as OpenAI's `codex`.
- ([#13656](https://github.com/quarto-dev/quarto-cli/issues/13656)): Fix R code cells with empty `lang: ""` option producing invalid markdown class attributes.
4 changes: 3 additions & 1 deletion src/resources/rmd/hooks.R
Original file line number Diff line number Diff line change
Expand Up @@ -1120,8 +1120,10 @@ is_label_type <- function(type, label) {

block_attr <- function(id = NULL, lang = NULL, class = NULL, attr = NULL) {
id <- labelId(id)
if (!is.null(lang)) {
if (!is.null(lang) && nzchar(lang)) {
lang <- paste0(".", lang)
} else {
lang <- NULL
}
if (!is.null(class)) {
class <- paste(block_class(class))
Expand Down
20 changes: 20 additions & 0 deletions tests/docs/smoke-all/2025/11/07/13656.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: "Empty lang option should not produce invalid class (#13656)"
format: html
keep-md: true
_quarto:
tests:
html:
ensureFileRegexMatches:
- []
- ['\{\. \.cell-code\}'] # Should NOT have invalid literal class in HTML
---

## Test Case

R code cell with empty lang option should not produce invalid class:

```{r}
#| lang: ""
23
```
Loading