about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/util/html.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/javascript/flavours/glitch/util/html.js')
-rw-r--r--app/javascript/flavours/glitch/util/html.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/util/html.js b/app/javascript/flavours/glitch/util/html.js
index 0b646ce58..5159df9db 100644
--- a/app/javascript/flavours/glitch/util/html.js
+++ b/app/javascript/flavours/glitch/util/html.js
@@ -1,6 +1,5 @@
 export const unescapeHTML = (html) => {
   const wrapper = document.createElement('div');
-  html = html.replace(/<br \/>|<br>|\n/g, ' ');
-  wrapper.innerHTML = html;
+  wrapper.innerHTML = html.replace(/<br\s*\/?>/g, '\n').replace(/<\/p><p>/g, '\n\n').replace(/<[^>]*>/g, '');
   return wrapper.textContent;
 };