diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2017-10-30 11:10:04 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2017-10-30 11:10:04 +0100 |
commit | 61db8615f4921c12c4c7090e87701b1bdbb2c186 (patch) | |
tree | a64a8b37f3566a2722acb2ed48fde547df910f6b /apps/comments | |
parent | 76c803f0afba3c6207f0b6e9d224cbd8af1783ab (diff) | |
download | nextcloud-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.js | 10 |
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(); }, |