12

In comments, I frequently find myself linking to other questions, usually because something is very similar to a frequently-asked question but I'm not quite confident enough to deploy the dupehammer. For example:

Inside a Docker container, `localhost` usually refers to "this container",
not the containing host.  Do the approaches in [From inside of a Docker
container, how do I connect to the localhost of the machine?]
(https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach)
help you?

Usually I do this by finding the canonical question, and manually copying the title and URL into the comment (I'm sure scripts exist to automate this somewhat). However, this eats up a lot of space in a size-limited comment field, especially when I want to link to multiple other questions.

Would it make sense to have dedicated markup shorthand to link to questions, that automatically includes the title? You'd have to know the question ID to use it but it's right there in the URL.

Do the approaches in [question:24319662] help you?
9
  • 4
    I’d be nice if this also extended to the markdown available in custom flags. I find a similar issue when trying to link several questions/answers in a single flag and end up doing a lot of [1](/q/1234567). Also a meta option might be nice (similar to the tag magic links) [meta-question:1234567].
    – Henry Ecker Mod
    Commented Jan 27, 2022 at 14:34
  • I've seen this requested on MSE several times, usually it's that links shouldn't count towards the character limit of the comment.
    – bad_coder
    Commented Jan 27, 2022 at 14:53
  • Not a bad idea actually, it is a decent compromise to having it take up too much space in a comment versus needing to implement comment parsing tricks to do specific length calculations. It opens the gate to a person putting dozens of links in a comment... but that doesn't seem like a realistic event.
    – Gimby
    Commented Jan 27, 2022 at 15:16
  • 2
    Why use the full URL when you can also use https://stackoverflow.com/q/24319662 instead? The "share" function under each post generates that for you.
    – Tom
    Commented Jan 27, 2022 at 15:36
  • You can put all sorts of things into long links sagecell.sagemath.org/…
    – PM 2Ring
    Commented Jan 27, 2022 at 15:50
  • 1
  • @Tom very true, and very convenient. I would certainly upvote that suggestion as an answer to this meta post. But the purpose of this request is basically to minimise the amount of characters a url "steals" from the total allowed and the proposed method goes one step beyond.
    – Gimby
    Commented Jan 27, 2022 at 16:14
  • 2
    To me the comment character limit is less of a concern than having to manually copy/paste both URL and title. That's a needless chore.
    – isherwood
    Commented Jan 27, 2022 at 16:29
  • 1
    @isherwood At least there's a userscript for that; it's not perfect (especially when you want a raw URL), but it's super handy otherwise.
    – zcoop98
    Commented Jan 27, 2022 at 17:27

0

You must log in to answer this question.