Skip to content

Commit

Permalink
fixed error when lang of raw figure was empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Servostar committed Jul 22, 2024
1 parent 4e82edc commit dd8ed6e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/style.typ
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@
show raw: set text(font: style.code.font, size: style.code.size)
show figure.where(kind: raw): it => align(left)[
#let content = it.body
#let lang = if content.has("lang") {
it.body.lang
} else {
none
}
#block(
width: 100%,
fill: ABB-GRAY-06,
Expand All @@ -97,15 +102,15 @@
let (i, l) = e
let n = i + 1
let n_str = if (calc.rem(n, 1) == 0) or (true and i == 0) { text(font: style.code.font, size: style.code.size, fill: ABB-BLACK, str(n)) } else { none }
(n_str + h(0.5em), raw(lang: content.lang, l))
(n_str + h(0.5em), raw(lang: lang, l))
})
}
else {
( ( 1fr, ),
( left, ),
e => {
let (i, l) = e
raw( lang:content.lang, l)
raw( lang: lang, l)
}
)
}
Expand Down
5 changes: 5 additions & 0 deletions template/appendix.typ
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@
== More raw data

#lorem(50)

#figure(
```
```
)

0 comments on commit dd8ed6e

Please sign in to comment.