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 <[email protected]> wrote in <[email protected]>:
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 <[email protected]> >> wrote in <[email protected]>:
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: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 47:50:06 |
| Calls: | 12,112 |
| Calls today: | 3 |
| Files: | 15,010 |
| Messages: | 6,518,503 |