I am writing text that primarily describes a lot of URLs. The problem is that many of these URLs can be very long.
Fortunately, >95% of my readers will use a on-screen pdf reader, not a printout. So, I want a solution that makes it clear to print readers that my URL is incomplete (not allowing them to click), and to screen readers that they can just clicks to go to the deep page.
The best simple solution I can think of is that \http{www.example.com/morelevel/andmorelevel/andyetmorelevel/andmore/andmore/andmore} should produce something like \href{www.example.com/morelevel/andmorelevel/andyetmorelevel/andmore/andmore/andmore}{\uline{www.example.com/+}}. If there are no deeper links, the '+' would be omitted. (would one use xstrings.sty to implement this?)
A more sophisticated solution would endnote each unique URL (i.e., superscript increasing number), and produce an index-like alpha-sorted or page-sorted list at the end of the document for print readers (\href{www.example.com/morelevel/andmorelevel/andyetmorelevel/andmore/andmore/andmore}{\uline{www.example.com}$^\arabic{urlcounter}$}) or something like it.
I also may or may not like URL breaking and/or display of the http://.
These are not bibtex questions, but main text questions. I am also probably not the only one who has encountered this need.
May I ask how others have solved this?


url.parse. That'll be more robust thanstr:findand also correctly unescapes things like%20. – Henri Menke Apr 30 '21 at 10:48