Skip to content

Commit 22766be

Browse files
authored
Merge branch 'main' into create/file-permissions
2 parents c0fc947 + d577ef4 commit 22766be

7 files changed

Lines changed: 56 additions & 12 deletions

File tree

news/changelog-1.10.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
All changes included in 1.10:
22

3+
## Formats
4+
5+
### `typst`
6+
7+
- ([#14261](https://github.com/quarto-dev/quarto-cli/issues/14261)): Fix theorem/example block titles containing inline code producing invalid Typst markup when syntax highlighting is applied.
8+
39
## Commands
410

511
### `quarto create`

src/quarto.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,6 @@ export async function quarto(
196196

197197
try {
198198
await promise;
199-
for (const [key, value] of Object.entries(oldEnv)) {
200-
if (value === undefined) {
201-
Deno.env.delete(key);
202-
} else {
203-
Deno.env.set(key, value);
204-
}
205-
}
206199
if (commandFailed()) {
207200
exitWithCleanup(1);
208201
}
@@ -213,6 +206,14 @@ export async function quarto(
213206
} else {
214207
throw e;
215208
}
209+
} finally {
210+
for (const [key, value] of Object.entries(oldEnv)) {
211+
if (value === undefined) {
212+
Deno.env.delete(key);
213+
} else {
214+
Deno.env.set(key, value);
215+
}
216+
}
216217
}
217218
}
218219

src/resources/filters/customnodes/theorem.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,9 @@ end, function(thm)
259259
ensure_typst_theorems(type)
260260
local preamble = pandoc.Plain({pandoc.RawInline("typst", "#" .. theorem_type.env .. "(")})
261261
if name and #name > 0 then
262-
preamble.content:insert(pandoc.RawInline("typst", 'title: "'))
262+
preamble.content:insert(pandoc.RawInline("typst", 'title: ['))
263263
tappend(preamble.content, name)
264-
preamble.content:insert(pandoc.RawInline("typst", '"'))
264+
preamble.content:insert(pandoc.RawInline("typst", ']'))
265265
end
266266
preamble.content:insert(pandoc.RawInline("typst", ")["))
267267
local callthm = make_scaffold(pandoc.Div, preamble)

tests/docs/smoke-all/crossrefs/theorem/algorithm.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ _quarto:
2222
-
2323
- "#ref\\(<alg-gcd>, supplement: \\[alg.\\]\\)"
2424
- "#ref\\(<alg-gcd>, supplement: \\[Alg.\\]\\)"
25-
- "#algorithm\\(title: \"Euclid\"\\)"
25+
- "#algorithm\\(title: \\[Euclid\\]\\)"
2626
- []
2727
markdown:
2828
ensureFileRegexMatches:

tests/docs/smoke-all/crossrefs/theorem/lemma-1.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ _quarto:
2020
ensureTypstFileRegexMatches:
2121
-
2222
- "#ref\\(<lem-line>, supplement: \\[Lemma\\]\\)"
23-
- "#lemma\\(title: \"Line\"\\)"
23+
- "#lemma\\(title: \\[Line\\]\\)"
2424
- []
2525
markdown:
2626
ensureFileRegexMatches:

tests/docs/smoke-all/crossrefs/theorem/theorem-1.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ _quarto:
2121
ensureTypstFileRegexMatches:
2222
-
2323
- "#ref\\(<thm-line>, supplement: \\[Theorem\\]\\)"
24-
- "#theorem\\(title: \"Line\"\\)"
24+
- "#theorem\\(title: \\[Line\\]\\)"
2525
- "#import \"@preview/theorion:0\\.4\\.1\": make-frame"
2626
- "simple-theorem-render"
2727
-
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
format:
3+
typst:
4+
keep-typ: true
5+
_quarto:
6+
tests:
7+
typst:
8+
ensureTypstFileRegexMatches:
9+
-
10+
- "title: \\["
11+
-
12+
- "\\(title: \""
13+
---
14+
15+
# Theorem Test - Inline Code in Title
16+
17+
::: {#exm-devtools}
18+
19+
## `devtools`
20+
21+
A useful package for R developers.
22+
23+
```r
24+
install.packages("devtools")
25+
```
26+
27+
:::
28+
29+
::: {#thm-bayes}
30+
31+
## `P(A|B)` = Bayes' Rule
32+
33+
If $P(B) > 0$, then $P(A|B) = \frac{P(B|A)P(A)}{P(B)}$.
34+
35+
:::
36+
37+
See @exm-devtools and @thm-bayes.

0 commit comments

Comments
 (0)