Skip to content

Links with highlight#153

Open
tuncbkose wants to merge 1 commit into
itsjunetime:mainfrom
tuncbkose:tbk/links3
Open

Links with highlight#153
tuncbkose wants to merge 1 commit into
itsjunetime:mainfrom
tuncbkose:tbk/links3

Conversation

@tuncbkose
Copy link
Copy Markdown

@tuncbkose tuncbkose commented Jun 6, 2026

Hello. This is yet another attempt at implementing link support (#81).

I was playing around with this independently (and made a bad implementation) when I realized that @perhurt had a nice looking but slightly outdated PR at #95. This PR is a combination of #95 and me implementing highlighting instead of the links menu. I would like to note that I didn't built on top of that branch directly as to avoid having to rebase but if this PR may get merged, @perhurt should get credits as well. I can try to include them in the git history if we get there.

I am aware of at least 3 issues:

  • if there are multiple pages visible, cycling between links doesn't cross page boundaries
  • the link ordering from mu-pdf may be a bit weird. At least, I had 2 documents I tried with, one that I compiled from typst and the example pdf from clickable PDF links; added webbrowser, query link handling, and click… #135. The former was fine but the latter had a unexpected ordering.
  • mu-pdf seems to split one link into multiple if it crosses line boundaries. I've implemented some logic to detect that and combine them so the entire link would be highlighted but currently the logic is incomplete because I couldn't find any margin information (see renderer.rs::extract_page_links).

I am also not very experienced with Rust so any feedback is welcome.

I will try to look into the issues along with adding mouse support like #135, but if someone else built upon this (or implemented this feature independently) I would be very happy as well.

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.

1 participant