157

In questions, links get converted into question titles (see Replace trilogy raw links with the current question title?)

Can the same functionality be added to comments?

6

4 Answers 4

111

This would be especially useful on mobile devices, where:

  • Cutting and pasting the title of a question and then its URL is a huge pain, because it involves switching back and forth between the comment page and the page with the question to be linked, without the aid of windows or tabs.

  • Have you ever tried editing Markdown on a mobile device? Moving the cursor and selecting bracket characters is not fun. And better get it right the first time, because clicking the edit button afterwards is even harder.

  • Userscripts aren't available on mobile.

As for Jeff's objections why it can't be done:

  • "Comments are processed on the fly." Look up the title once and add the Markdown that we would otherwise have to type manually. (If that ends up making the comment too long, there are lots of ways to handle it, the simplest of which is to only do the conversion when it will fit.)

  • "If you want this, put your links in a post, where it is already supported." That's not a very good reason. You're basically arguing that we shouldn't even have comments.

    • Edit, thirteen years later!: I think maybe what Jeff meant is comments are meant to be ephemeral. Intentionally crippling comments is a feature, because it encourages us to incorporate feedback from comments into the post, as I am doing now.
6
  • 20
    I wholeheartedly agree. I will often comment on my phone as well. There's no reason the transformation couldn't happen when the comment is first accepted. Commented Mar 4, 2012 at 22:52
  • 1
    commenting for me on my Android only works with the Hacker's Keyboard, which has up-and down arrows etc.
    – rubo77
    Commented May 4, 2014 at 14:03
  • 2
    @DavidHarkness "There's no reason the transformation couldn't happen when the comment is first accepted." There might be a length limit problem, but in that case the transformation could either be ignored or done nevertheless. Commented May 29, 2020 at 7:10
  • I think it's a little more complicated with the question of how to deal with comment length limits (truncate? how much truncation is too much? what if there's literally no more room?). the simple answer to that would just be: truncate titles up to some fixed extent as long as there's room for it, and then leave the rest of the links untouched.
    – starball
    Commented Mar 11 at 8:02
  • Thanks, @starball, see my edits to the post. Over a decade later, I think finally get it. :) Commented Mar 11 at 15:46
  • 1
    It's still a giant pain in the arse. I often provide links to related questions in comments, and I always have to visit the page, copy the URL, paste in my other tab, go back, copy the title paste in the tab. The argument that this is a feature is ridiculous. We are even encouraged to share links, by way of having a badge for it. There are times where doing this in comments is more appropriate.
    – paddy
    Commented Apr 18 at 23:24
-11

As a fast workaround, you can easily convert the question to a link by those steps:

Example URL:

https://meta.stackexchange.com/questions/148999/cross-site-question-parsing-for-question-urls-in-comments
  1. Paste it into the commentbox
  2. Shift+Ctrl+<-- repeat until you marked the question part of the url cross-site-question-parsing-for-question-urls-in-comments that is not needed in the post.
  3. Ctrl+x
  4. type )
  5. Ctrl+<-- repeat to the beginning of the URL
  6. type [Ctrl+v](

this will look like this:
cross-site-question-parsing-for-question-urls-in-comments

whis is quite satisfying in a comment, and close to
Cross-site question parsing for question URLs in comments

(see also https://meta.stackexchange.com/a/230991/188615)

1
  • 11
    Not all that satisfying IMO, and it costs valuable characters! Commented May 5, 2014 at 17:56
-11

I don't think full titles are all that useful in most cases.

We already have [site.SE] as a short-hand for a link to http://site.stackexchange.com (and the SOFU exceptions, of course). Therefore, I think a useful middle ground would be [site.SE/(q|a)/ID] which would become [site.SE/ID](http://site.stackexchange.com/(q|a)/ID).

As an alternative (or in addition), translate [text](site.SE/(q|a)/ID) to [text](http://site.stackexchange.com/(q|a)/ID).

-68
+500

No, because comments are processed on the fly. This means a page with 12 links would incur 12 additional database queries -- every time the page is loaded.

Comments are meant to be lightweight. If you want this, put your links in a post, where it is already supported.

13
  • 1
    Although I am also not really agree with the request, but api does allow vectorized requests, that would not really cost 12 database queries for 12 links, isn't it?
    – YOU
    Commented Apr 11, 2011 at 7:55
  • 32
    This could be cached, so the database hits should not be an issue. Stop blaming the database when you mean "I don't think the value of X is worth the programming time" Commented Apr 11, 2011 at 11:43
  • 2
    @ian database queries are never free, no matter how clever we are. The fundamental issue is that comments are always processed on the fly, unlike posts which store both raw and cooked representations. Commented Apr 11, 2011 at 18:33
  • 56
    But why can't this be done in a static way? i.e. look up the title once when the comment gets created. Having to do this manually all the time is terribly cumbersome and time-consuming.
    – Pekka
    Commented Apr 30, 2011 at 13:27
  • @Pekka You'd have to modify the raw comment content in that case, which would mean that trying to edit the comment afterward would show you something different than what you typed. That doesn't seem like the best solution.
    – Tim Stone
    Commented Apr 30, 2011 at 13:52
  • 21
    @Tim but that could be solved by an alternative syntax, say a leading ! in front of the link as a sign that you want it converted. This would be really helpful
    – Pekka
    Commented Apr 30, 2011 at 13:54
  • @Pekka True, but you run the risk of going over the comment length limit by modifying the content in an automated way, which could cause issues. I'm sure it's doable anyway, but I can see why it might not be worth it. That said, gimme a few minutes for that userscript...
    – Tim Stone
    Commented Apr 30, 2011 at 13:57
  • 2
    Just made a similar request at meta.tex.stackexchange.com/questions/1673/…, and was told about this post. Although I understand the reasoning, they are still truncated and the left portion is displayed, so why not just display the trailing portion of the link, at least then there would be some meaningful info before mouse over. Commented Aug 9, 2011 at 0:58
  • 7
    @TimStone In the extraordinarily rare event that it would cause the comment length to overflow, just don't do the conversion. Commented Dec 22, 2011 at 13:50
  • 6
    @TimStone Userscripts don't work on my iPhone. Try adding a comment with a link to a question and its title, adding the markdown formatting by hand on a mobile device. It's not fun. Commented Dec 22, 2011 at 13:54
  • 3
    I've posted another answer addressing these objections. Commented Dec 22, 2011 at 14:06
  • 1
    Is this the similar problem with this: Expand links to Stack Exchange questions to show titles in chat when starred? Commented Dec 12, 2014 at 16:08
  • 7
    Okay, so the current implementation makes this difficult. Why not change the implementation then? Store "raw and cooked" representations of the comments.
    – Ajedi32
    Commented Feb 2, 2015 at 16:45

You must log in to answer this question.

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