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

Don't show cell-output-display div when output: asis #7622

Merged
merged 2 commits into from
Dec 11, 2023

Conversation

cderv
Copy link
Collaborator

@cderv cderv commented Nov 17, 2023

Follow up on #4703 and trying to solve #7600

Currently, we do still add

::: {.cell-output-display}

when outputing knit_asis class content

Opening this PR to see how this simple change is impacted our tests - I feel this is a little change that could have side effect, especially because in our R knitr code output: asis means results: asis and both are not decoupled.

Though this change match our doc (https://quarto.org/docs/computations/execution-options.html#raw-output)

When output: asis is specified none of Quarto’s standard enclosing divs will be included.

However, I can see too that output: asis as the lowest priority if other options are provided.

# if there is a label, additional classes, a forwardAttr, or a cell.cap
# then the user is deemed to have implicitly overridden results = "asis"
# (as those features don't work w/o an enclosing div)
needCell <- isTRUE(nzchar(label)) ||
length(classes) > 1 ||
isTRUE(nzchar(forwardAttr)) ||
isTRUE(nzchar(cell.cap))
if (identical(options[["results"]], "asis") && !needCell) {
x
} else {
paste0(
options[["indent"]], "::: {",
labelId(label), paste(classes, collapse = " ") ,forwardAttr, "}\n", x, "\n", cell.cap ,
options[["indent"]], ":::"
)
}
})

This change a bit what we discussed, especially regarding #7607

@cderv cderv marked this pull request as draft November 17, 2023 14:21
@cscheid
Copy link
Collaborator

cscheid commented Dec 6, 2023

I'm going to close this one, @cderv, since the fix is the opposite of what we thought.

@cscheid cscheid closed this Dec 6, 2023
@cderv
Copy link
Collaborator Author

cderv commented Dec 6, 2023

Yep all good! Thank you

@cscheid cscheid reopened this Dec 8, 2023
@cscheid cscheid marked this pull request as ready for review December 8, 2023 16:34
@cderv cderv linked an issue Dec 8, 2023 that may be closed by this pull request
@cderv cderv merged commit 1607899 into main Dec 11, 2023
47 checks passed
@cderv cderv deleted the fix/output-asis-no-display branch December 11, 2023 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quarto ignores output:asis and throws cell-output-display div
2 participants