hyperlinks in comments truncating

Apr 29, 2008 at 3:05 PM
On http://www.kevinskorner.net/blog/post/2008/04/C---Single-Application-instance.aspx, a link someone posted in my comments was truncated from http://en.csharp-online.net/ApplicationArchitectureinWindowsForms2.0%E2%80%94Single-InstanceDetectionandManagement to en.csharp-online.net/...ctureinWindowsForms2.0%E2%80%94Single-InstanceDetectionand_Management. The first part of the link is translated to a hyperlink but the last part is left off make the user have to copy and paste. Is there a better way to do hyperlinks in comments?
May 1, 2008 at 1:23 PM
Looks like the ResolveLinks extension stops at % characters (either by design else it's a bug)

Wishing BBCode extension would support this kind of code in comments:
[url:read this architecture post|http://en.csharp-online.net/whatever%80instance/]

That way a commenter can give a more meaningful link description.
Hyperlink truncating wouldn't happen either by showing it more friendly to the eye.

For example:
"Useful post, thanks for sharing! If you're into C# architecture, I highly recommend to read this Single Instance and Mgt article"

I'm sorry it isn't a direct answer to your question, though I hope the BBCode or ResolveLinks extensions will provide a better way soon.

Cheers,
Mike
May 1, 2008 at 3:46 PM
thanks
Sep 12, 2010 at 7:55 PM

Two and a half years later and we still don't have a fix for the url truncating in the comments. Nor does the BBCode allow for a URL type parsing, yet. May just have to edit the BBCode cs file to come up with a URL parser.

Coordinator
Sep 12, 2010 at 11:34 PM

The descriptive/text part of the URL is being shortened so long URLs are not shown (some URLs can really be long).  The actual URL in the HREF is not shortened -- it's preserved.

If you don't like the shortening, you can modify the ResolveLinks.cs file in the App_Code\Extensions folder.  Change MAX_LENGTH from 50 to int.MaxValue.

Sep 13, 2010 at 4:19 AM
BenAmada wrote:

The descriptive/text part of the URL is being shortened so long URLs are not shown (some URLs can really be long).  The actual URL in the HREF is not shortened -- it's preserved.

If you don't like the shortening, you can modify the ResolveLinks.cs file in the App_Code\Extensions folder.  Change MAX_LENGTH from 50 to int.MaxValue.

The link being shortened is not the issue.  The issue is that any link with URL encoding ends up being broken, i.e.:

Valid Link:
http://www.amazon.com/s/?url=search-alias%3Daps&tag=rgr-20&field-keywords=kindle

ResolveLinks turns into:
http://www.amazon.com/s/?url=search-alias%3Daps&tag=rgr-20&field-keywords=kindle

 

Resolve Links breaks anytime there is a valid encoding in the URL that begins with '%'.

 

Coordinator
Sep 15, 2010 at 10:41 AM

Thanks, I understand now... made a note for myself to fix this.  Will post back here when fixed.

Coordinator
Sep 28, 2010 at 12:42 PM

This has been fixed in 1.6.2.8.