0
0
Fork 0

Preserve newlines in delete & redraft and desktop notifications (#7750)

Fix #7748
This commit is contained in:
Eugen Rochko 2018-06-06 20:49:53 +02:00 committed by GitHub
parent b7b331ad0d
commit c75493755f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

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;
};