Better way to link February 18, 2007 10:16 AM   Subscribe

Is there be a better way to automate links in comments and answers?
posted by SteveInMaine to Feature Requests at 10:16 AM (23 comments total)

I've noticed of late that more comments have a link to a website written out, but not linked to (i.e. http://www.metafilter.com, rather than metafilter). This is probably because of some users' unfamiliarity with html.

Currently, when making a comment or answer, the link popup prompts the user for the site link, but not the text that goes with the anchor link. Wouldn't it be possible to add something like "Description for your link" to the prompt, then create the full link with text?
posted by SteveInMaine at 10:17 AM on February 18, 2007


Currently, when making a comment or answer, the link popup prompts the user for the site link, but not the text that goes with the anchor link. Wouldn't it be possible to add something like "Description for your link" to the prompt, then create the full link with text?

If no text is selected when the link button is pressed, "OK" on the prompt drops the cursor exactly where the linked text should go. Then you just type.
posted by carsonb at 10:21 AM on February 18, 2007


I've noticed of late that more comments have a link to a website written out, but not linked to ... This is probably because of some users' unfamiliarity with html.

AFAICT, the way MeFi's link button works is a fairly common functionality on web-based email and even word processing programs these days. People munge links cuz they're lazy and dumb.
posted by saguaro at 10:35 AM on February 18, 2007


As it stands, the B, I, and link buttons all function in the same way (you have highlight the text first, or else type in between the tags). I'd think it'd be more confusing if one of the buttons functioned differently.
posted by occhiblu at 10:37 AM on February 18, 2007


Though I do agree, the non-linked links are annoying!
posted by occhiblu at 10:38 AM on February 18, 2007


I've been considering doing a WYSIWYG comment box like vox or this, but imagine it with a minimum of options. I'd also add the option to turn it off completely and retain the way things are now for the old school HTML aware people.
posted by mathowie (staff) at 10:54 AM on February 18, 2007 [1 favorite]


Here's a simple demo that I could massage into working there. It even works on Safari, which is nice.
posted by mathowie (staff) at 11:22 AM on February 18, 2007 [1 favorite]


Maybe an extra sentence in the pop-up link box would help. Some thing like, "then type between the ><'s to anchor/label your link(your cursor will be there already)" I think people try to use it, but don't realize what exactly it does and they don't see the link in preview yet, so they think they messed it up.
posted by lee at 11:42 AM on February 18, 2007


If you do incorporate a WYSIWYG, yes, definitely make it optional.
posted by cortex at 12:13 PM on February 18, 2007 [1 favorite]


Can't get the link function to work on that demo, matt (FF2.0, Ubuntu 6.06)
posted by Abiezer at 12:14 PM on February 18, 2007


Yeah, there's a bug (near line 1236).

Are you definitely going with ActivEdit, Matt? Because using a more minimal script instead of a full-featured but mostly-disabled one like ActivEdit would be better for bandwidth, maintenance, browser-compatibility etc.

In your example, ActivEdit adds 80KB to the page! (OK that'll be cached most of the time, but still...)
posted by matthewr at 12:26 PM on February 18, 2007


what about just adding some code to the posting script that would match anything starting with http:// and replace it with a link, e.g. the text string http://www.goatse.cx becomes http://www.goatse.cx?
posted by sergeant sandwich at 12:58 PM on February 18, 2007


why not just have a regexp that checks if <a href=" has http:// as the next 7 characters?, if not append it.
posted by furtive at 1:23 PM on February 18, 2007


Easiest would probably be to stuff the words "link text" between the tags and leave it up to the user to figure out they need to type text there. Second easiest would be along the lines of what sergeant sandwich and furtive said.
posted by SteveInMaine at 2:34 PM on February 18, 2007


Would it be difficult to also have a TITLE text box that gets inserted along with the link?
posted by cenoxo at 3:20 PM on February 18, 2007


You could also add, below the current comment box, a line of simple instructions like "To include a link in your comment, type this: [a href="http://www.toast.com"]best toast website[/a] Your link will go to www.toast.com, and the text "best toast website" will show up in color in your comment." (But replace the square brackets with angle brackets. I haven't figured out how to just mention html commands in plain text.)
posted by LobsterMitten at 3:24 PM on February 18, 2007


sergeant sandwich writes "what about just adding some code to the posting script that would match anything starting with http:// and replace it with a link"

Please don't, sometimes you don't want a link.
posted by Mitheral at 4:43 PM on February 18, 2007


I like autolinking, even though I know how to make a link.

The number of times someone doesn't want a bare URL to be a link is very small. You can just change the http to hxxp or something...
posted by smackfu at 4:49 PM on February 18, 2007


And sometimes you're linking with https://, or mailto:, or telnet://, or any number of other URLhandlers. RegExes are just hamhanded.

Most of the ones the site currently runs on comments have bizarre consequences — the letters s-r-c, concatenated in lowercase are stripped wherever they appear. A small tag followed by "posted by" causes an error message saying that your comment "appears to be empty". Please don't add more.
posted by blasdelf at 6:35 PM on February 18, 2007


Oh god do I hate Vox's input boxes. "You put HTML in your comment/post, did you want me to convert that?" No, I want you to make a ham sandwich out of it the size of Cleveland, with which I shall end world hunger for one short lunchtime (sadly, the ham sandwich is not a sustainable solution).
posted by Eideteker at 9:12 PM on February 18, 2007


sergeant sandwich: "What about just adding some code to the posting script that would match anything starting with http:// and replace it with a link?"

The Linkifier Plus Greasemonkey script does exactly that. And since I have it installed, it made your comment a little hard to understand.
posted by Plutor at 3:47 AM on February 19, 2007


Greasemonkey is the hackiest hack that ever hacked.
posted by smackfu at 6:32 AM on February 19, 2007


A greater compliment I cannot imagine.
posted by Plutor at 8:40 AM on February 19, 2007


« Older Searching for user on Music to show players?   |   SXSW 2007 - meetup? Newer »

You are not logged in, either login or create an account to post comments