9

When I wish to share a link to a post in a comment this is my workflow:

  • write []()
  • search for the question
  • remember the title of the question
  • click on the share box
  • copy the link
  • paste into parentheses
  • write the title in the square brackets
    • realize the title is probably wrong
    • back to the question copy the title
    • paste into square brackets
  • write the rest of the comment etc.

Maybe there's something obvious I've missed for 3 years, but especially on a mobile device or the mobile app this is very tedious.

Through debate on a question on meta.stackoverflow (and having seen the referenced meta.programmers FAQ) a "new" standard is appearing of adding a markdown copy-past snippet to FAQ questions

quick links in FAQ post bodies

This makes it easy to quickly refer users to a question/answer in comments (and chat).

Should a markdown link be part of the platform, e.g. added to the share box directly?

  • Related: meta.stackexchange.com/questions/77394/… – 3ventic May 23 '14 at 9:03
  • 1
    @AD7six or you could do what I do and make your workflow a lot simpler. (1) type the []() (2) open search in a new tab. (3) find question (4) copy link and paste back in first tab (5) go back to 2nd tab and copy title and paste. .... now a way to do this in 1 or 2 clicks would be easier, but a lot simpler than what you do – psubsee2003 May 23 '14 at 9:15
  • 1
    @psubsee2003 That's no different than I put in the question, just always-assuming I can't remember the title (would be slightly streamlined though!). However, of most relevance that's an absolute PITA on a mobile device - at least on android you're pretty much guaranteed to overwrite at least one of the parentheses on paste, but that's of course not SE's fault. – AD7six May 23 '14 at 9:16
7

This always bugged me too. And I created a couple of solutions:

Userscript

Convert share links to markdown [title](url), available at Stack Apps.

The script opens with Markup as default:

       


And clicking clean url will restore the original link:

       

JavaScript/jQuery bookmarklet

See Create Bookmarklets - The Right Way

  • Open the browser bookmark manager.
  • Add a new one with a short title and position it on the bookmark bar.
  • Paste the following as the URL:

    javascript:(function(){ $tit = $('#question-header h1 a').text(); $('#question .post-menu .short-link').click(); $url = $('.share-tip input').val(); $('.share-tip a.close-share-tip').click(); $result = '[' + $tit + '](' + $url + ')'; window.prompt("Copy to clipboard: Ctrl+C, Enter", $result); })();
    
  • Clicking the bookmarklet will open a browser dialog with the [title](link) text ready to copy:


    enter image description here

Here's the unminified script:

javascript:(function(){ 
    $tit = $('#question-header h1 a').text(); 
    $('#question .post-menu .short-link').click(); 
    $url = $('.share-tip input').val(); 
    $('.share-tip a.close-share-tip').click(); 
    $result = '[' + $tit + '](' + $url + ')'; 
    // http://stackoverflow.com/a/6055620/1287812
    window.prompt("Copy to clipboard: Ctrl+C, Enter", $result); 
})();

bonus
Here's another version with pure JavaScript that works with any site:

javascript:(function(){ var result='['+document.title+']('+document.URL+')'; window.prompt("Copy to clipboard: Ctrl+C, Enter", result); })();
| improve this answer | |
1

I also would like to see this be an actual feature. I've made another userscript to do this, similar to brasofilo's but this adds multiple options as well as keeping the original URL-only link:

enter image description here

| improve this answer | |

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