From d727e0e34c8c45161e24fce3180f80983e461dc7 Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 1 Oct 2018 20:24:00 -0500 Subject: [PATCH] Fix #3939: Quoting a post with apostrophes replaces them with '. --- app/views/comments/new.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/comments/new.js.erb b/app/views/comments/new.js.erb index 95648fdab..54e0ad635 100644 --- a/app/views/comments/new.js.erb +++ b/app/views/comments/new.js.erb @@ -2,7 +2,7 @@ var $div = $('div.comments-for-post[data-post-id="<%= @comment.post_id %>"] div. $div.find(".expand-comment-response").click(); var $textarea = $div.find("textarea"); -var msg = "<%= j @comment.body %>"; +var msg = <%= raw @comment.body.to_json %>; if ($textarea.val().length > 0) { msg = $textarea.val() + "\n\n" + msg; }