152

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

107

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." Just look up the title once and add the Markdown that we would otherwise have to type manually.

  • "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.

3
  • 19
    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. 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
    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. May 29, 2020 at 7:10
-9

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).

-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! May 5, 2014 at 17:56
-66
+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
    Apr 11, 2011 at 7:55
  • 31
    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" 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. Apr 11, 2011 at 18:33
  • 54
    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
    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
    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
    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
    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. 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. 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. Dec 22, 2011 at 13:54
  • 3
    I've posted another answer addressing these objections. 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? 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
    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 .