summaryrefslogtreecommitdiffstats
path: root/apps/comments
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-10-30 11:10:04 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-10-30 11:10:04 +0100
commit61db8615f4921c12c4c7090e87701b1bdbb2c186 (patch)
treea64a8b37f3566a2722acb2ed48fde547df910f6b /apps/comments
parent76c803f0afba3c6207f0b6e9d224cbd8af1783ab (diff)
downloadnextcloud-server-61db8615f4921c12c4c7090e87701b1bdbb2c186.tar.gz
nextcloud-server-61db8615f4921c12c4c7090e87701b1bdbb2c186.zip
preserve line breaks
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/comments')
-rw-r--r--apps/comments/js/commentstabview.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js
index e061ed35330..7b5a25b7e8e 100644
--- a/apps/comments/js/commentstabview.js
+++ b/apps/comments/js/commentstabview.js
@@ -587,6 +587,16 @@
$inserted.html('@' + $this.find('.avatar').data('username'));
});
+ var oldHtml;
+ var html = $comment.html();
+ do {
+ // replace works one by one
+ oldHtml = html;
+ html = oldHtml.replace("<br>", "\n"); // preserve line breaks
+ console.warn(html)
+ } while(oldHtml !== html);
+ $comment.html(html);
+
return $comment.text();
},