Skip to content

Commit ad43414

Browse files
Leave out the hostname and protocol when auto generating the reply markdown.
1 parent 909d18d commit ad43414

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

views/includes/scripts/commentReplyScript.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,21 @@
2929
var $author = $comment.find('.topic-meta-data .names .username').first();
3030
var $replyTextarea = $('#reply-control textarea[name="comment-content"]');
3131
var value = null;
32+
var reUrl = null;
3233

3334
$('#reply-control').collapse('show');
3435

3536
document.location.hash = $comment.attr('id');
3637

38+
reUrl = document.location.pathname + document.location.hash;
39+
reUrl = reUrl.replace(/\(/g, '%28').replace(/\)/g, '%29');
40+
3741
value = $replyTextarea.val();
3842
if (!/^\s*$/.test(value)) {
3943
// Add linebreaks if reply already started.
4044
value += '\n\n';
4145
}
42-
value += '[Re](' + document.location.href.replace(/\(/g, '%28').replace(/\)/g, '%29') + '): ';
46+
value += '[Re](' + reUrl + '): ';
4347
value += '@' + $author.text() + ': ';
4448
value += ' \n';
4549
$replyTextarea.val(value);

0 commit comments

Comments
 (0)