Skip to content

Join consecutive inline links - #8797

Draft
PgBiel wants to merge 14 commits into
mainfrom
collect-links
Draft

Join consecutive inline links#8797
PgBiel wants to merge 14 commits into
mainfrom
collect-links

Conversation

@PgBiel

@PgBiel PgBiel commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

This PR essentially transfers responsibility of making text links clickable from each piece of text to the paragraph's line layout. This allows joining consecutive link bounding boxes together in a single line, ensuring a single #link call generates a single clickable area (for each line).

(Notably, this does not address #6248, as each line will still produce a different link bounding box, but could definitely be a step forward in that direction.)

By introducing the necessary infrastructure to detect changes in styles mid-paragraph (particularly link styles), this PR is thus the first step before moving decoration handling to paragraphs as well, in order to fix various issues under #7802.

I've attempted to cleanup commit history a bit (not fully), so checking commit-by-commit should be possible if that's desirable.

TODO

  • Verify minor changes in link bounding box tests
  • Support for RTL text
  • Fix #hide
  • Address any remaining tests

- also attempt to use links() instead of entries()

- break on empty link
@saecki

saecki commented Aug 28, 2026

Copy link
Copy Markdown
Member

Actually #6248 is already implemented, but only enabled when exporting PDF/UA-1 documents, because there isn't wide-spread support for quadpoints in PDF viewers.

@PgBiel
PgBiel force-pushed the collect-links branch 2 times, most recently from 85dc46f to 715c547 Compare September 1, 2026 03:11
(todo: consider if this is desirable as is, cf. equations)
logical indices ignore RTL reordering. This fixes RTL.

Note that RTL reordering might cause links to become discontinuous, so the code includes a check that creates separate link boundaries as needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants