Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ All changes included in 1.8:
- ([#13085](https://github.com/quarto-dev/quarto-cli/pull/13085)): Avoid `kbd` shortcode crashes on unknown OS keys.
- ([#13164](https://github.com/quarto-dev/quarto-cli/pull/13164)): add `julia` to execute schema to allow autocomplete suggestions. (@mcanouil)
- ([#13121](https://github.com/quarto-dev/quarto-cli/issues/13121)): Allow `contents` shortcode to find inline elements.
- ([#13216](https://github.com/quarto-dev/quarto-cli/issues/13216)): Properly disable `downlit` (`code-link`) and enable `code-annotations` when non-R code blocks are present.


## Quarto Internals
Expand Down
11 changes: 9 additions & 2 deletions src/resources/rmd/rmd.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,14 @@
# within a code chunk
for (x in seq_along(chunkStarts)) {
start <- chunkStarts[x]
end <- chunkEnds[x]
# Ensure end is greater than start
end <- start
for (e in chunkEnds) {
if (e > start) {
end <- e
break
}
}
for (y in start:end) {
if (y > start && y < end) {
chunkMap[y] <- TRUE
Expand All @@ -112,7 +119,7 @@

# look for at least one annotations that is in a code chunk
for (a in annotations) {
if (chunkMap[a] == TRUE) {
if (chunkMap[a]) {
hasAnnotations <- TRUE
break
}
Expand Down
24 changes: 24 additions & 0 deletions tests/docs/smoke-all/2025/08/14/issue13216.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: "Issue 13216"
format: html
code-annotations: below
code-link: true
_quarto:
tests:
html:
ensureHtmlElements:
-
- "dl.code-annotation-container-grid"
---

`downlit` (`code-link`) should be disable and `code-annotations` should be enabled.

```
hello
```

```{r}
2 + 2 # <1>
```

1. This should be styled as a popup.
Loading