This is essentially the same script as @cai's, except it displays the markdown in the same way as if you would edit the comment:

Tested on Chrome with Tampermonkey.
// ==UserScript==
// @name Show Comment Markdown
// @namespace cai
// @version 0.2b
// @description Show the Markdown source of a comment, useful for copy/pasting.
// @author Cai (edited by me)
// @include https://stackoverflow.com/*
// @include https://serverfault.com/*
// @include https://superuser.com/*
// @include https://meta.stackoverflow.com/*
// @include https://meta.serverfault.com/*
// @include https://meta.superuser.com/*
// @include https://stackapps.com/*
// @include https://*.stackexchange.com/*
// @include https://askubuntu.com/*
// @include https://meta.askubuntu.com/*
// @include https://mathoverflow.net/*
// @include https://meta.mathoverflow.net/*
// @include https://area51.stackexchange.com/proposals/*
// @exclude https://chat.*/*
// @grant none
// ==/UserScript==
/*jshint multistr: true */
function with_jquery(f) {
var script = document.createElement("script");
script.type = "text/javascript";
script.textContent = "(" + f.toString() + ")(jQuery)";
document.body.appendChild(script);
}
with_jquery(function ($) {
$('head').append(
$(
'<style>' +
'.show-markdown-link { \
cursor: pointer; \
color: #9199a1; \
opacity: 0; \
} \
.comment .show-markdown-link { \
opacity: 1; \
}' +
'</style>'
)
);
$(document).ajaxComplete(function(){
$('.comments').each(make_copy_links);
});
$('.comments').each(make_copy_links);
function make_copy_links() {
$(this).find('.comment:not(:has(a.comment-edit)):not(:has(span.show-markdown-link)) .comment-body').each(function () {
$('<span class="show-markdown-link" title="Source">| Source</span>').click(show_markdown).appendTo(this);
});
}
function show_markdown() {
var comment = $(this).closest(".comment");
var chtmlid = comment.attr("id");
var cdash = chtmlid.lastIndexOf('-');
var comment_id = chtmlid.substring(cdash + 1);
var markdown;
var textarea;
if(comment.has('form.SCCoS').length) {
markdown = $('div#SCCoS-source-' + comment_id).html();
$('#SCCoS-' + comment_id).show();
comment.find('.comment-text').prop('class', comment.find('.comment-text').prop('class') + ' comment-form');
comment.find('.comment-body').hide();
textarea = comment.find('textarea.SCCoS');
reset_textarea(textarea, markdown);
} else {
$.getJSON(window.location.protocol + '//api.stackexchange.com/2.2/comments/' + comment_id + '?site=' + window.location.hostname + '&filter=!)Q29lpdRHRpfMsqok1CFj-3(',
function (data) {
markdown = data.items[0].body_markdown;
var comment_text = $('#comment-' + comment_id).find('.comment-text');
comment_text.prop('class', comment_text.prop('class') + ' comment-form');
comment_text.append('\
<form class="SCCoS dno" style="display:block" id="SCCoS-' + comment_id + '"> \
<div id="SCCoS-source-' + comment_id +'" class="dno">' + markdown + '</div> \
<table> \
<tbody class="js-comment-form-layout"> \
<tr> \
<td> \
<textarea name="comment" cols="68" rows="3" class="SCCoS"></textarea> \
</td> \
<td> \
<input id="SCCoS-close-' + comment_id + '" tabindex="0" type="button" value="Close"> \
<br> \
<a class="SCCoS-closeall edit-comment-cancel" tabindex="0">close all</a> \
</td> \
</tr> \
</tbody> \
</table> \
</form>'
).find('.comment-body').hide();
textarea = comment_text.find('textarea');
init_textarea(textarea, markdown);
$('#SCCoS-close-' + comment_id).click(function() {
hide_markdown(comment_id);
});
$('.SCCoS-closeall').click(function() {
hide_markdown();
});
}
).fail(function(jqXHR, textStatus, errorThrown) {
alert('Request failed! ' + textStatus);
});
}
}
function init_textarea(JQtextarea, text) {
JQtextarea.html(text).focus();
}
function reset_textarea(JQtextarea, text) {
JQtextarea.css('height', '5em');
JQtextarea.val(text).focus();
}
function hide_markdown(comment_id) {
if(comment_id === undefined) {
$('form.SCCoS').each(function () {
var id = $(this).prop('id');
if(id.startsWith('SCCoS-')) {
hide_markdown(id.replace('SCCoS-',''));
}
});
} else {
$('#SCCoS-' + comment_id).hide();
var comment = $('#comment-' + comment_id);
comment.find('.comment-text').prop('class', comment.find('.comment-text').prop('class').replace(' comment-form',''));
comment.find('.comment-body').show();
}
}
});