Coffeehouse Thread

3 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Forum suggestion for Charles

Back to Forum: Coffeehouse
  • User profile image
    rhm

    Is there any chance of adding some code to the comment posting mechanism alongside the de-swearer that compresses the long URLs that people keep posting?  Although it does my head in that people are too lazy to add links properly by selecting some text, hitting the link button and pasting the link into the input box that comes up and just paste the link into the text of the comment instead - I've given up hoping that people will change however much I complain.

    Although it won't stop the layout getting blown up when people inline massive images, it would solve most of the problems since people post URLs more often.

    So, go over the <a> tags in the post, leave the href attribute as is obviously and then if the text between the <a> and </a> is a URL and longer than some number  of characters (50 perhaps?), shorten it using some algorithm link how Windows Explorer shortens paths in the title bar.

    Please!

  • User profile image
    Maurits

    Two possible methods suggest themselves to me...
    1) Use a regex to find things like >http://...< and shorten them
    2) make a fixed width to the post box and have horizontal scrollbars (ugh) for those posts that are wider than their box

    Here's a variation of a regex I've used:

    pat.Pattern = ">((http://|https://|ftp://)[~\-\w&/=.,?;%\#+@]{80,})<"
    If pat.Test(body) Then
        body = pat.Replace(body, ">[Long URL]<")
    End If
    

  • User profile image
    Manip

    K.I.S.S.

    Leave it alone.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.