13

SOFU links pasted into questions get automatically replaced by the question title. This has been this way for some time now, and it's great.

However, it is missing from comments. This is very annoying, but apparently by design, although I don't really understand why.

Anyway, seeing as this is probably unlikely to change - does a Greasemonkey or user script exist that emulates the behaviour? Meaning that if I attempt to post a comment with a raw SOFU link in it, the script automatically looks up the question title, and replaces the link, before it gets submitted.

(If it's possible at all to do this - I have no idea whether an Ajax question title lookup is doable....)

6

2 Answers 2

10

I wrote a script for this purpose. Please see this StackApps posting for more information.

5
  • Brilliant, thanks very much! I will look into this later today.
    – Pekka
    Commented Apr 30, 2011 at 16:47
  • Very nice, works like a charm. Thanks!
    – Pekka
    Commented May 1, 2011 at 17:33
  • one more report, I cannot paste deleted post link anymore - probably getting error and comment does not get submitted.
    – YOU
    Commented May 2, 2011 at 12:43
  • @YOU Ah, good catch, this should be fixed now (it'll just leave the link as-is)
    – Tim Stone
    Commented May 2, 2011 at 15:20
  • Nice, its working now. Thanks again.
    – YOU
    Commented May 2, 2011 at 15:23
7

As a workaround, George Edison was kind enough to write Copy Question Link Markdown - Making it easier to copy links to questions! This script adds a copy button to questions, which generates markdown with the link and question title, e.g. [Userscript to auto-replace SOFU links in comments?](http://meta.stackexchange.com/questions/89378/userscript-to-auto-replace-sofu-links-in-comments).

Note that both the link text and the description text will count against the comment length limit. You may want to trim the URL down to http://meta.stackexchange.com/q/89378.

2
  • Excellent, this is a big step already!
    – Pekka
    Commented Apr 30, 2011 at 15:56
  • @Pekka: That's a great idea for my script (trimming the length of the generated URL). Commented Apr 30, 2011 at 19:10

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