From 26c20a4ec7868753b284670575f28f201a5cef9f Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Fri, 15 Jun 2018 21:31:08 +0200 Subject: [Glitch] Preserve newlines in delete & redraft and desktop notifications Port c75493755f482d0506884b1f7b7b44e5306a4d8b to glitch-soc --- app/javascript/flavours/glitch/util/html.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'app/javascript/flavours/glitch/util/html.js') 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(/
|
|\n/g, ' '); - wrapper.innerHTML = html; + wrapper.innerHTML = html.replace(//g, '\n').replace(/<\/p>

/g, '\n\n').replace(/<[^>]*>/g, ''); return wrapper.textContent; }; -- cgit