From 4bced848ee8d358809f3c184215b38adbf3fdec0 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 9 Nov 2022 19:31:53 +0200 Subject: [PATCH] same as last commit --- files/assets/js/comments_v.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/files/assets/js/comments_v.js b/files/assets/js/comments_v.js index 74760ec9b..dad0607e1 100644 --- a/files/assets/js/comments_v.js +++ b/files/assets/js/comments_v.js @@ -69,10 +69,12 @@ function ToggleReplyBox(id) { let text = getSelection().toString().trim() if (text) { - text = text.split('> \n> Reply')[0] - textarea.value = '> ' + text - textarea.value = textarea.value.replace(/\n/g,"\n> ").replace(/\*/g,"\\*") - if (!textarea.value.endsWith('\n')) textarea.value += '\n' + text = '> ' + text + text = text.replace(/\n/g,"\n> ").replace(/\*/g,"\\*") + text = text.replace(/\n> \n/g,"\n \n") + if (!text.endsWith('\n')) text += '\n' + text = text.split('\n> Reply')[0] + textarea.value = text } textarea.focus() }