I don't think the last one is a safe solution, since querystrings can make that still a very long adjusted URL.
I think the formula in my head is "remove all directory information after the domain name, and remove all query string stuff after the name of the document, if there is any"
so
www.somewhere.com/blah/blah/blah/blah/blah/porn.htm
becomes
www.somewhere.com/[...]/porn.htm
and
www.somewhere.com/blah/blah/login.php?x=123456&y=123456&z=123456
becomes
www.somewhere.com/[...]/login.php
or something like that.
It's the query strings that are normally the problem, not the dirs, right?
Starting with John H.'s post 501 in Buffistatech, everything is aligned with the bullets he made. Which means the page alignment is off.
I like the third option, because I like if possible to know what file type is being linked to, so that I don't click on a 10MB .exe file by mistake. (Not that any Buffista would post such a thing without warning, but we have to plan for contingencies yada yada yada.)
John, as long as you regexp it, it's all good.
I think i broke the Firefly thread
I think you left out a quotation mark around the URL in the A tag, Allyson.
ETA -- try fixing that, and then let's see what happens.
If you are looking at automatically fixing long URLs, why not wrap them in an
t A HREF="theOverLongURL"
tag, with a generic link text (such as "long URL") followed by the
t /A
Because the alternatives proposed are more informative, and as long as John does the hard part of the work, all otherwise equivalent to me.