9

Often I want to link to an existing question on the SE network in a comment or even a question/answer. One way to do this is by using the Share button. The link will be given in the form https://stackexchange-site.com/q/question-id/user-id, and you can simply post it. But the result doesn't look nice or at least informative enough when compared to the links created by the automated "Possible duplicate of XYZ" posts when casting Close As Duplicate votes.

To simulate the links from the "Possible duplicate" posts one needs to

  1. On the question page, get the share link
  2. Switch to the page where the link is to be posted
  3. Type [](the-link-you-copied) in the text entry field
  4. Switch back to the question page
  5. Try to select the caption, avoiding dragging it (since it's a hyperlink)
  6. Copy it
  7. Switch to the page where the link is to be posted
  8. Paste the caption between the [] you've typed

That's inconvenient. Is there an easier way to do this? If not, I'd like to request one of the following

  • A Markdown-formatted link in the format [Question Caption?](https://question-url) as a possible format in the Share popup (Imgur does something similar when you upload an image);

  • Automatic transformation of the links like https://stackoverflow.com/q/question-id/... and similar with other SE domains into hyperlinks with the caption of the question linked to (we already have the Linked panel, but it lacks context);

  • Something other, if the options above are not good enough.

3

You can use @JasonC's More Share Links (Markdown / HTML / BBCode) userscript as a workaround.

The userscript creates additional fields in the standard Stack Exchange share dialog:

More share links

For some reason, it didn't work for me right away and I had to fix a couple of things. I've uploaded an updated script on Github:

You'll probably need to install a userscript manager browser extension (e.g. Tampermonkey) first.

  • This actually directly addresses my first bullet point, thanks. – Ruslan Jul 17 at 5:44
6

Is there an easier way to do this?

I use a FireFox extension for this called Copy as Markdown.

To get the link for this question:

  • Right Click (outside of the edit box)
  • Select "Copy [Page Title](URL)"
  • Paste from clipboard

enter image description here

Result:

Is there an easy way to post nice hyperlinks to questions? - Meta Stack Exchange.

Another couple of mouse clicks to add attribution:

Asked by Ruslan.

There is a version of this extension for Chrome as well (I haven't tried it).

Features:

Copy as Markdown is a browser extension helps you copy the following things as Markdown to your system clipboard:

  • Current Tab as Link
  • A Link in the Page
  • An Image in the Page
  • An Image that is wrapped with a Link
  • All Tabs as a List of Links
  • Highlighted Tabs as a List of Links

Source chitsaou/copy-as-markdown: Copying Link, Image and Tab(s) as Markdown Much Easier.

  • That looks like a good workaround. You won't get the Announcer badge for such links though :P – Ruslan Jul 16 at 14:00
  • @Ruslan There only one badge I'm actually chasing and care about and it's not Announcer :) – DavidPostill Jul 16 at 21:08
0

If you place the link copied from share on its own line, it will be formatted nicely.

You must log in to answer this question.

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