Skip to content

Commit 1e64da5

Browse files
Fix Typst definition list structure for PDF/UA-1
Preserve terms element structure in definition lists for PDF/UA-1 validation. Uses nested show rule instead of .map().join() which destroyed the list structure. Suggested by @mcanouil (PR #13249 discussion) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 75b9002 commit 1e64da5

File tree

2 files changed

+34
-6
lines changed

2 files changed

+34
-6
lines changed

src/resources/formats/typst/pandoc/quarto/definitions.typ

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@
1717
#stack(dir: ltr, spacing: 3pt, super[#num], contents)
1818
]
1919

20+
// Use nested show rule to preserve list structure for PDF/UA-1 accessibility
21+
// See: https://github.com/quarto-dev/quarto-cli/pull/13249#discussion_r2678934509
2022
#show terms: it => {
21-
it.children
22-
.map(child => [
23-
#strong[#child.term]
24-
#block(inset: (left: 1.5em, top: -0.4em))[#child.description]
25-
])
26-
.join()
23+
show terms.item: item => {
24+
set text(weight: "bold")
25+
item.term
26+
block(inset: (left: 1.5em, top: -0.4em))[#item.description]
27+
}
28+
it
2729
}
2830

2931
// Some quarto-specific definitions.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: "UA-1 definition list accessibility"
3+
lang: en
4+
pdf-standard: ua-1
5+
keep-typ: true
6+
_quarto:
7+
tests:
8+
typst:
9+
# Definition lists should pass PDF/UA-1 validation
10+
# Fix: https://github.com/quarto-dev/quarto-cli/pull/13249#discussion_r2678934509
11+
noErrors: default
12+
---
13+
14+
# Definition List Test
15+
16+
This tests that definition lists are accessible in PDF/UA-1.
17+
18+
Term 1
19+
: Definition for term 1
20+
21+
Term 2
22+
: Definition for term 2
23+
24+
Term 3
25+
: Definition for term 3 with more detailed explanation
26+
that spans multiple lines.

0 commit comments

Comments
 (0)