Skip to content

PDF export raises internal error "expected link ancestor in logical tree" #7777

Closed

Description

@RensOliemans

Description

When running typst c test.typ, I get this error:

error: internal error: expected link ancestor in logical tree (occurred at crates/typst-pdf/src/link.rs:88:10)

with test.typ:

#show link: underline
#link("https://example.com")[#image("globe.svg") linktext] something else

I believe this is a pretty minimal test case, the only occurs when #show ..., #image(), linktext and something else all coincide.

This isn't too big of a deal: I planned on removing the underline anyway, but typst told me to please report this as a bug.

$ typst --version
typst 0.14.2 (b33de9de)

Reproduction URL

No response

Operating system

NixOS

Typst version

  • I am using the latest version of Typst (see above)

Activity

  1. added
    bug
    on Jan 29, 2026
  2. added
    pdf
    internals
    and removed
    internals
    on Jan 29, 2026
  3. laurmaedje commented on Jul 5, 2026

    @laurmaedje
    Member

    Here's another reproduction (from #8608):

    #set text(hyphenate: true)
    #block(width: 1cm)[#link("x")[test]ing]
  4. changed the title [-]Compiler error with underlined link text, with image in link text[/-] [+]PDF export raises internal error "expected link ancestor in logical tree"[/+] on Jul 5, 2026
  5. added
    accessibility
    on Jul 5, 2026
  6. self-assigned this
    on Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

accessibilitybugpdf

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions