What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 133 Stack Exchange communities.

It often happens that people will refer to other questions by simply pasting the full link to this question, especially on Meta.

Would it be a good idea to detect such links, and replace them directly by a formatted link on their current title?

Example:

 You can try formatting at this
 question:
 http://meta.stackexchange.com/questions/49424/stack-exchange-sandbox

Would be automatically changed in:

You can try formatting at this question: Stack Exchange Sandbox

It would make links given by new users (unaware of the full syntax) more elegant, and it would also be faster when more regular (and lazy) users want to point to another question without making the usual "see it at this other place"


Edit: Note that this behaviour is implemented already for the "possible duplicate" auto comments, so the question here is not about "how to do this technically".

share|improve this question
3  
Would be problematic for questions like meta.stackexchange.com/questions/45046 unless we included some manner of truncation (and then, how would we decide how long it should be?) –  Grace Note May 10 '10 at 14:57
3  
Question titles change, would you want them to be updated or not? would you like the "closed" of a closed question to be included or not? –  jmfsg May 10 '10 at 14:58
2  
@Downvoter - it's only an help on the moment the message is posted, so only with the current title. No need to update it further. About the closed, not sure, it doesn't bring a lot of information at this point, only noise, probably. –  Gnoupi May 10 '10 at 15:12
1  
@ccornet - the new limit of 150 chars makes it already more "presentable". Either way, most of time the copied link contains already a long part of the title. So not much difference in this case. –  Gnoupi May 10 '10 at 15:14
    
@Gnoupi I never caught the update on the title character limits. Thanks! –  Grace Note May 10 '10 at 15:17
3  
Adding a bounty. Please please implement this. It is so annoying to have to copy over the question title and link it –  Pëkka Nov 3 '10 at 11:10
    
    
Adding another bounty. This is SOOOO annoying and doesn't deserve the status-completed tag yet –  Pëkka Jan 31 '11 at 12:00
    
2  
I created a feature request to implement this functionality in comments: meta.stackexchange.com/questions/77394/… –  Alex B Feb 1 '11 at 18:29

5 Answers 5

up vote 13 down vote accepted

For intra-site links (like, SO -> SO) this is now supported.

http://meta.stackexchange.com/questions/49424/stack-exchange-sandbox

becomes*

Stack Exchange Data Explorer

Like with tag rewrites this is done on post submission and is not currently reflected in the editor preview. It will always insert the current title into the post, at post creation time. However, should the title subsequently change it will not be updated unless the post is edited.

*Note that although the old title of the question is in the link, the new one is inserted.

share|improve this answer
    
Awesome! Is this triggered on edit? Will it be rolled out to the stack exchange sites? –  Alex B Nov 5 '10 at 6:00
1  
@Alex - it is triggered on edit, and will be available on all of the SE sites within the hour. –  Kevin Montrose Nov 5 '10 at 6:00
1  
Would you consider adding this for inter-SE links too? –  Tobias Kienzler Nov 8 '10 at 12:28
3  
@Kevin: Could you add this to comments? meta.stackexchange.com/questions/49424/stack-exchange-sandbox –  Gnome Nov 9 '10 at 20:48
1  
@Arjan - it will always insert the current title into the post, at post creation time. However, should the title subsequently change it will not be updated unless the post is edited. –  Kevin Montrose Dec 13 '10 at 7:33
    
I guess it's by design that the Markdown <bare url> syntax gets one the title too? (If not: currently the <..> syntax also is replaced by the title.) –  Arjan Dec 13 '10 at 10:30
    
This doesn't seem to always work though. Are there some special rules? And it definitely doesn't work in comments. –  Pëkka Jan 31 '11 at 12:01
    
Sometimes it works too well: sometimes even links in code blocks are changed, and also links that are explicitly linked manually to avoid replacement (like in revision 1 and 2 here). –  Arjan Jan 31 '11 at 12:13
    
Now that this post is on MSE but the link still refers to MSO, editing this very post seems to break the auto-linking, while a bare URL on MSO pointing to MSE works just fine: maybe auto-linking on MSE should also support links to other metas? And curious, @Kevin: the revision history of this very post currently shows the bare link. Does that imply that the HTML is rendered on the fly for the revision history? –  Arjan Apr 20 at 15:20
    
Ah, it seems that redirections are not handled, at least not in the preview: linking from MSE to MSO, and the other way around, still works when referring to new posts, just not so much for migrated posts. Like meta.stackoverflow.com/questions/49424/stack-exchange-data-explorer which currently redirects to meta.stackexchange.com/questions/49424/stack-exchange-data-explorer and is not rewritten with its old URL (at least not in the preview). –  Arjan Apr 21 at 7:18

I like this idea a lot, it would save me from having to generate links the "right" way and I do think it would make the site a lot cleaner. I think it would also make comments much more elegant. I do, however, fear that it might be a pain to implement. (Not sure about that, really depends a lot on how the backend works. As Brandon pointed out, it might not be that difficult after all.)

EDIT: this is now supported:

Replace trilogy raw links with the current question title?

AWESOME!

share|improve this answer
2  
I don't think it'd be hard to implement, they've already done it with the close as exact duplicate function. –  Brandon May 10 '10 at 15:03
    
That's an excellent point. –  The Unhandled Exception May 10 '10 at 15:04
1  
@Brandon It's slightly different. Closing links are generated as part of the closing function, so the function can choose to format it as it likes. This proposal would be parsing actual post content and editing it. –  Grace Note May 10 '10 at 15:08
2  
@ccornet - duplicated links are inserted in the actual post content as well. –  Gnoupi May 10 '10 at 15:12
2  
@Gnoupi But they're inserted. They aren't edited from existing links. Still feasible, but it's inaccurate to say it's the same. –  Grace Note May 10 '10 at 15:16
    
@ccornet, you are absolutely right, I didn't consider the fact that one is automatic. –  Brandon May 10 '10 at 15:22
4  
@ccornet: Amazon links are already automatically rewritten. Doesn't this imply that parsing and editing of content already takes place? –  ire_and_curses May 10 '10 at 15:24
    
@ire I will concede that the functionality already exists (I never claimed it wasn't). But that's not part of the duplicate question linking functionality. –  Grace Note May 10 '10 at 15:26
    
THANKS FOR THE REPS!!! –  The Unhandled Exception Feb 6 '11 at 21:33

To indicate that this is an automated link and more importantly to which SE-site it links, a small logo could be placed next to the question title

edit feature-requested

share|improve this answer
    
Nice idea indeed. –  Gnoupi Aug 9 '10 at 15:24

Could we not add a new button to the Toolbar - link to SE question.

alt text

This could open a popup where you

  • Select the site that the question is on (drop down?)

    • Then search for the question to link to (similar to how the Title textbox works when asking a new question.)

      Or

    • Enter the question number to link to.

The popup validates that it is a valid question and then inserts the nice formatted link in to your answer/question for you.

I think it should handle multiple inserts elegantly too. By that I mean it should take care of the " see here, here, here and here " type of linking.

EDIT

Pekka's comment on this has just got me thinking about this.

The process for selecting links could be shortened somewhat by simply getting the user to enter the question/answer id. If one question or answer is found then it would simply add the nicely formatted link in. If there is more than one ID e.g. exists in more than one site then user selected which one they want and it adds in.

Another way to do this would be to enable some kind of shortcut pattern which is converted to a nice link when posted. The shortcut pattern could be a site ID and then Q/A ID.

Entering [SO:9033] in a post would be transformed to Hidden Features of C#? when posted.

Using 2-3 characters for the site code should be plenty enough to allow for existing sites and new sites.

share|improve this answer
5  
this seems awfully complex compared to "paste link" –  Jeff Atwood Nov 5 '10 at 7:50
    
@Jeff how about making that work then? –  Pëkka Jan 31 '11 at 17:34
    
@Pekka - I just added a couple more ideas in to my answer :) –  Barry Jan 31 '11 at 19:10

I like this idea.

However, there is a problem with punctuation and capitalization.

C++ Beginner - Trouble using classes inside of classes

would probably end up looking like

c beginner trouble using classes inside of classes

Which, as you can see, kind of changes what the question is about (C++ to c). This would be a problem unless you were committing to do a DB lookup every time a link is typed in/submitted in a comment or answer, in order to the get the correctly cased and punctuated title. Those lookups may add up (look at how many links I used in this post alone, so isn't necessarily a good idea in terms of performance. Although, Jeff might just want to throw some hardware at it.

Simple Spec

All links of the format

"http://[((meta.)?stackoverflow|superuser|serverfault).com/questions/[\d]/ < QuestionTitle>"

(Could somebody fix my regex, I'm rusty)

would automatically be converted to

< QuestionTitle>

Or, if the question title is too long

vb net how to require checkedlistbox... or VB.NET: how to require CheckedListBo...

This would only be done once, at the time that the comment or question is initially linked. If the title of the question changes, the comment text would not change, because the link itself has not changed.

This magical replacement does not apply to people who are linking directly to answers, edit pages, or specific revisions. It could theoretically work for user pages, or tag pages.

Second option

A second alternate implementation would be to green jagged underline the link (like a grammar error), and have a rollover click option that says "convert to title hyperlink" or some such text. This would do the conversion that I described earlier, except that it would be optional. Further, because it would be replacing the text before the user has submitted the comment, it shows them how to do linking correctly (which they might not now) and it gives them the chance to change how it will appear. This is almost ALWAYS better than any "autocorrect" options. I hate autocorrect.

The (rather large) downside is that this would be more difficult to implement than a straight Regex replace.

share|improve this answer
2  
Do close-question comments/links have that same punctuation/capitalization problem? If not, then we could mesh the title-fetching nature of those links instead of using the raw URL's title text. This would also allow people to post raw links with just the ID and benefit from this system (as sometimes occurs). –  Grace Note May 10 '10 at 15:50
1  
@ccornet I believe you are correct. The performance implications would not be very severe –  devinb May 10 '10 at 16:18
    
what's do bad about a db lookup every time a link is typed in/submitted in a comment or answer? –  Ian Ringrose Aug 4 '10 at 12:49
    
@Ian, I suppose doing a lookup on post wouldn't be so bad. But doing it on every typed link would be terrible. We shouldn't be firing of possibly limitless db pings. It would easily open up for a malicious Denial of Service attack, even an accidental one. –  devinb Aug 4 '10 at 13:05
    
How do you think the reputation is reported? I don't think they rewrite an HTML page everytime to record the rep on a certain page. There are DB Requests going on all over the place. That's what makes the site nice and dynamic. I don't follow your logic. –  staticx Aug 27 '10 at 20:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .