diff --git a/boards/static/js/thread.js b/boards/static/js/thread.js --- a/boards/static/js/thread.js +++ b/boards/static/js/thread.js @@ -77,7 +77,12 @@ function addQuickReply(postId) { // If this is not OP, add reflink to the post. If there already is // the same reflink, don't add it again. - if (!post.is(':first-child') && textAreaJq.val().indexOf(postLinkRaw) < 0) { + var postText = textAreaJq.val(); + if (!post.is(':first-child') && postText.indexOf(postLinkRaw) < 0) { + // Insert line break if none is present. + if (postText.length > 0 && !postText.endsWith('\n') && !postText.endsWith('\r')) { + textToAdd += '\n'; + } textToAdd += postLinkRaw + '\n'; } @@ -160,4 +165,4 @@ function showQuoteButton() { $("#quote-button").click(function() { addQuickQuote(); }) -}); \ No newline at end of file +});