File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed
src/resources/formats/typst/pandoc/quarto
tests/docs/smoke-all/typst Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 117117 // when we cleanup pandoc's emitted code to avoid spaces this will have to change
118118 let old_callout = it . body . children . at (1 ). body . children . at (1 )
119119 let old_title_block = old_callout . body . children . at (0 )
120- let old_title = old_title_block . body . body . children . at (2 )
120+ let children = old_title_block . body . body . children
121+ let old_title = if children . len () == 1 {
122+ children . at (0 ) // no icon: title at index 0
123+ } else {
124+ children . at (1 ) // with icon: title at index 1
125+ }
121126
122127 // TODO use custom separator if available
123128 let new_title = if empty (old_title ) {
127132 }
128133
129134 let new_title_block = block_with_new_content (
130- old_title_block ,
135+ old_title_block ,
131136 block_with_new_content (
132- old_title_block . body ,
133- old_title_block . body . body . children . at (0 ) +
134- old_title_block . body . body . children . at (1 ) +
135- new_title ))
137+ old_title_block . body ,
138+ if children . len () == 1 {
139+ new_title // no icon: just the title
140+ } else {
141+ children . at (0 ) + new_title // with icon: preserve icon block + new title
142+ }))
136143
137144 block_with_new_content (old_callout ,
138145 block (below : 0pt , new_title_block ) +
Original file line number Diff line number Diff line change @@ -34,12 +34,14 @@ This is a warning callout without an icon.
3434## Tip Callouts with icon=false {#no-icon-tip}
3535
3636
37- ::: {.callout-tip icon="false"}
37+ ::: {#tip-example .callout-tip icon="false"}
3838
3939A tip without a title and without an icon.
4040
4141:::
4242
43+ See @tip-example
44+
4345## Regular callout with icon {#with-icon-important}
4446
4547::: {.callout-important}
You can’t perform that action at this time.
0 commit comments