Skip to content

Commit d9f1872

Browse files
authored
Merge pull request #12442 from quarto-dev/fix/asciidoc-code-annotate
fix asciidoc code annotations following pandoc update
2 parents 8c6c1b7 + 569135a commit d9f1872

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/resources/filters/quarto-pre/code-annotation.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,10 +529,10 @@ function code_annotations()
529529
local dl
530530
if _quarto.format.isAsciiDocOutput() then
531531
local formatted = pandoc.List()
532-
for _i,v in ipairs(items) do
532+
for _,v in ipairs(items) do
533533
local annotationMarker = v[1] .. ' '
534534
local definition = v[2]
535-
tprepend(definition.content, {annotationMarker})
535+
tprepend(definition.content, {pandoc.RawInline('asciidoc', annotationMarker)})
536536
formatted:insert(definition)
537537
end
538538
dl = pandoc.Div(formatted)

tests/docs/smoke-all/2023/01/26/asciidoc-annotated-code.qmd

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@ format:
44
asciidoc: default
55
_quarto:
66
tests:
7-
asciidoc: default
7+
asciidoc:
8+
ensureFileRegexMatches:
9+
- ['\<1\> First set', 'plt\.show\(\) \<3\>']
10+
- ['\+\+\<\+\+1\+\+\>\+\+']
811
---
912

13+
This also covers https://github.com/quarto-dev/quarto-cli/issues/12441
14+
1015
## Annotated Code
1116

1217
```python

0 commit comments

Comments
 (0)