I have the following in my CSS to display the URLs ofYes. Use js
some links when the web document is printed:
@media print { a.showURL:after
{ content:" [URL " attr(href) "]"; }
}
That works fine, except that if a long URL happens to
occur midway on a line, it gets moved to the next line,
leaving a short line.
What I'd like to do is insert a zero-width space
​ after every slash except the initial https://.
I haven't been able to find a CSS way to do that, but I
thought it was worth asking in case I missed something.
Or is there some other way to accomplish this?
}
I
suppose I could use attr(title) instead of attr(href)
and put the URL-with-ZWSPs in the title attribute, but
that seems pretty clunky and will look ugly if a person
reading on screen happens to hover over the link.
On Thu, 19 Oct 2023 09:28:30 -0700, Stan Brown <the_stan_brown@fastmail.fm> wrote in <MPG.3f9af905f99041669901e2@news.individual.net>:
I have the following in my CSS to display the URLs of
some links when the web document is printed:
@media print { a.showURL:after
{ content:" [URL " attr(href) "]"; }
}
That works fine, except that if a long URL happens to
occur midway on a line, it gets moved to the next line,
leaving a short line.
What I'd like to do is insert a zero-width space
​ after every slash except the initial https://.
I haven't been able to find a CSS way to do that, but I
thought it was worth asking in case I missed something.
Or is there some other way to accomplish this?Yes. Use js
{ content:" [URL " attr(href).replace(/\//g,"/​").replace(/\/​\/​/,"//") "]"; }
}
On Thu, 19 Oct 2023 15:50:56 -0400, Y Lee Coyote wrote:
On Thu, 19 Oct 2023 09:28:30 -0700, Stan Brown <the_stan_brown@fastmail.fm> >> wrote in <MPG.3f9af905f99041669901e2@news.individual.net>:
I have the following in my CSS to display the URLs ofYes. Use js
some links when the web document is printed:
@media print { a.showURL:after
{ content:" [URL " attr(href) "]"; }
}
That works fine, except that if a long URL happens to
occur midway on a line, it gets moved to the next line,
leaving a short line.
What I'd like to do is insert a zero-width space
​ after every slash except the initial https://.
I haven't been able to find a CSS way to do that, but I
thought it was worth asking in case I missed something.
Or is there some other way to accomplish this?
{ content:" [URL "
attr(href).replace(/\//g,"/​").replace(/\/​\/​/,"//") >> "]"; }
}
Thanks for replying, but the W3c css validator threw four "CSS parse
error"s on that line.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 299 |
Nodes: | 16 (2 / 14) |
Uptime: | 54:48:48 |
Calls: | 6,690 |
Files: | 12,225 |
Messages: | 5,344,995 |