diff --git a/app/Http/Controllers/CommentController.php b/app/Http/Controllers/CommentController.php index 8b8eded8e..70a7825bd 100644 --- a/app/Http/Controllers/CommentController.php +++ b/app/Http/Controllers/CommentController.php @@ -34,7 +34,7 @@ class CommentController extends Controller $reply = new Status(); $reply->profile_id = $profile->id; - $reply->caption = e(strip_tags($comment)); + $reply->caption = e($comment); $reply->rendered = $comment; $reply->in_reply_to_id = $status->id; $reply->in_reply_to_profile_id = $status->profile_id; @@ -44,7 +44,7 @@ class CommentController extends Controller CommentPipeline::dispatch($status, $reply); if($request->ajax()) { - $response = ['code' => 200, 'msg' => 'Comment saved', 'username' => $profile->username, 'url' => $reply->url(), 'profile' => $profile->url()]; + $response = ['code' => 200, 'msg' => 'Comment saved', 'username' => $profile->username, 'url' => $reply->url(), 'profile' => $profile->url(), 'comment' => $reply->caption]; } else { $response = redirect($status->url()); } diff --git a/public/js/app.js b/public/js/app.js index e1e65874d..1d03a7288 100644 Binary files a/public/js/app.js and b/public/js/app.js differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 7d55e5864..6eb24f257 100644 Binary files a/public/mix-manifest.json and b/public/mix-manifest.json differ diff --git a/resources/assets/js/components/commentform.js b/resources/assets/js/components/commentform.js index e6c9cd391..a2aa50394 100644 --- a/resources/assets/js/components/commentform.js +++ b/resources/assets/js/components/commentform.js @@ -11,7 +11,7 @@ $(document).ready(function() { let el = $(this); let id = el.data('id'); let commentform = el.find('input[name="comment"]'); - let commenttext = $(commentform.val()).text(); + let commenttext = commentform.val(); let item = {item: id, comment: commenttext}; commentform.prop('disabled', true); @@ -21,6 +21,7 @@ $(document).ready(function() { var username = res.data.username; var permalink = res.data.url; var profile = res.data.profile; + var reply = res.data.comment; if($('.status-container').length == 1) { var comments = el.parents().eq(3).find('.comments'); @@ -28,7 +29,7 @@ $(document).ready(function() { var comments = el.parents().eq(1).find('.comments'); } - var comment = '

' + username + ''+ commenttext + '1s

'; + var comment = '

' + username + ''+ reply + '1s

'; comments.prepend(comment);