ClickableLinks

I’ve implemented the ClickableLinks patch:

http://wiki.bestpractical.com/index.cgi?ClickableLinks

from the Wiki. This works except that it doesn’t include the query
string in the link.

So, if I put in the URL: http://www.somehost.com?mypage
http://www.somehost.com/?mypage =1&var=2

All that the link uses is: http://www.somehost.com
http://www.somehost.com/

I assume this could be corrected with some regular expression magic, but
the implemented regexp is beyond the scope of anyone here. Can anyone
help modify this?

Thank you!

Here is the regexp used:

    $content =~

s@(https?://(?:(?:(?:(?:(?:a-zA-Z\d?).
)(?:a-zA-Z?))|(?:(?:\d+)(?:.(?:\d+)){
3}))(?::(?:\d+))?)(?:/(?:(?:(?:(?:[a-zA-Z\d$-_.+!
’(),]|(?:%[a-fA-F\d]{
2}))|[;:@&=#]))(?:/(?:(?:(?:[a-zA-Z\d$-_.+!’(),]|(?:%[a-fA-F\d]{2}))
|[;:@&=#]))))(?:?(?:(?:(?:[a-zA-Z\d$-.+!’(),]|(?:%[a-fA-F\d]{2}))
|[;:@&=#])
))?)?)|(?:ftp://(?:(?:(?:(?:(?:[a-zA-Z\d$-
.+!’(),]|(?:%[a
-fA-F\d]{2}))|[;?&=])
)(?::(?:(?:(?:[a-zA-Z\d$-.+!’(),]|(?:%[a-fA-F\d
]{2}))|[;?&=])
))?@)?(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)[a-zA
-Z\d])?).)
(?:a-zA-Z?))|(?:(?:\d+)(?:
.(?:\d+)){3}))(?::(?:\d+))?))(?:/(?:(?:(?:(?:[a-zA-Z\d$-
.+!’(),]|(?:%
[a-fA-F\d]{2}))|[?:@&=])
)(?:/(?:(?:(?:[a-zA-Z\d$-.+!’(),]|(?:%[a-fA
-F\d]{2}))|[?:@&=])
))*)(?:;type=[AIDaid])?)?)|(?:mailto:(?:(?:[a-zA-Z
d$-
.+!*’(),;/?:@&=]|(?:%[a-fA-F\d]{2}))+))@<a href="$1"
target="_blank">$1@g;

I’ve implemented the ClickableLinks patch:

http://wiki.bestpractical.com/index.cgi?ClickableLinks

from the Wiki. This works except that it doesn’t include the query
string in the link.

So, if I put in the URL: http://www.somehost.com?mypage
http://www.somehost.com/?mypage =1&var=2

There’s a space in there. These are two URLs. Perhaps your MUA is
mangling this.

If so, this is really broken. Don’t expect programs to fix up such
things. The regexp in the Wiki page doesn’t deal well with links split
over multiple lines either.

You could attempt to “fix” the regexp but it’ll be orders of magnitude
more complex…

-- Niels.

Hello Brandon,

–Am 13. Mai 2005 12:18:32 -0600 schrieb Brandon Pulsipher
brandonp@omniture.com:

I’ve implemented the ClickableLinks patch:

http://wiki.bestpractical.com/index.cgi?ClickableLinks

from the Wiki. This works except that it doesn’t include the query
string in the link.

instead of using the patch from the wiki you can use the callback, I have
implemented:
http://page.mi.fu-berlin.de/~pape/rt3/Callbacks/MI/Ticket/Elements/ShowMessageStanza/Default.

It supports some other URL types and avoids patching source. Just create a
directory
$your-rt-path/local/html/Callbacks/MI/Ticket/Elements/ShowMessageStanza/
and put the file in there.

I dont know if it solves your problem though.

Regards, Dirk.

Thank you Dirk. I rolled back the patch and installed this. After
figuring out how badly the browser was messing up the file and getting
via telnet to port 80, it’s in and working well.

I’d suggest the Wiki be updated to use this solution, since it doesn’t
involve a patch.

Only issue I see is that if the query string is long enough to wrap, it
breaks. This callback must get processed after the code that inserts
HTML new lines “
” to make the comments more readable. Not sure if
that’s done when adding the comments or not. If there’s a way around
this, let me know.

Thank you very much!From: Dirk Pape [mailto:pape-rt@inf.fu-berlin.de]
Sent: Saturday, May 14, 2005 3:20 AM
To: Brandon Pulsipher; rt-users@lists.bestpractical.com
Subject: Re: [rt-users] ClickableLinks

Hello Brandon,

–Am 13. Mai 2005 12:18:32 -0600 schrieb Brandon Pulsipher
brandonp@omniture.com:

I’ve implemented the ClickableLinks patch:

http://wiki.bestpractical.com/index.cgi?ClickableLinks

from the Wiki. This works except that it doesn’t include the query
string in the link.

instead of using the patch from the wiki you can use the callback, I
have
implemented:
<http://page.mi.fu-berlin.de/~pape/rt3/Callbacks/MI/Ticket/Elements/Show
MessageStanza/Default>.

It supports some other URL types and avoids patching source. Just create
a
directory
$your-rt-path/local/html/Callbacks/MI/Ticket/Elements/ShowMessageStanza/
and put the file in there.

I dont know if it solves your problem though.

Regards, Dirk.