diff --git a/crates/typst-layout/src/rules.rs b/crates/typst-layout/src/rules.rs index 32fdbe1f9..594f88496 100644 --- a/crates/typst-layout/src/rules.rs +++ b/crates/typst-layout/src/rules.rs @@ -179,9 +179,9 @@ const TERMS_RULE: ShowFn = |elem, _, styles| { for child in elem.children.iter() { let mut seq = vec![]; seq.extend(unpad.clone()); - seq.push(child.term.clone().strong()); + seq.push(PdfMarkerTag::ListItemLabel(child.term.clone().strong())); seq.push(separator.clone()); - seq.push(child.description.clone()); + seq.push(PdfMarkerTag::ListItemBody(child.description.clone())); // Text in wide term lists shall always turn into paragraphs. if !tight { diff --git a/crates/typst-pdf/src/tags/mod.rs b/crates/typst-pdf/src/tags/mod.rs index 8833d0cd1..a2ad47d7d 100644 --- a/crates/typst-pdf/src/tags/mod.rs +++ b/crates/typst-pdf/src/tags/mod.rs @@ -18,7 +18,7 @@ use typst_library::introspection::Location; use typst_library::layout::RepeatElem; use typst_library::model::{ Destination, EnumElem, FigureCaption, FigureElem, HeadingElem, ListElem, Outlinable, - OutlineEntry, TableCell, TableElem, + OutlineEntry, TableCell, TableElem, TermsElem, }; use typst_library::pdf::{ArtifactElem, ArtifactKind, PdfMarkerTag, PdfMarkerTagKind}; use typst_library::visualize::ImageElem; @@ -81,6 +81,10 @@ pub(crate) fn handle_start( let numbering = ListNumbering::Decimal; // TODO: infer numbering from `enum.numbering` push_stack(gc, loc, StackEntryKind::List(ListCtx::new(numbering)))?; return Ok(()); + } else if let Some(_enumeration) = elem.to_packed::() { + let numbering = ListNumbering::None; + push_stack(gc, loc, StackEntryKind::List(ListCtx::new(numbering)))?; + return Ok(()); } else if let Some(_) = elem.to_packed::() { // Wrap the figure tag and the sibling caption in a container, if the // caption is contained within the figure like recommended for tables