[Glitch] Preserve newlines in delete & redraft and desktop notifications

Port c75493755f to glitch-soc
This commit is contained in:
Thibaut Girka authored and ThibG committed 2018-06-16 15:09:28 +02:00
1 parent a01faecfcb
commit 26c20a4ec7
2 files changed
+5 -5

No files matched your search

+1 -2
View File
@@ -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;
};