diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2018-06-06 20:49:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-06 20:49:53 +0200 |
commit | c75493755f482d0506884b1f7b7b44e5306a4d8b (patch) | |
tree | c2584348329651d4312cdec33d08c80ae9ab0bac /app/javascript/mastodon/utils | |
parent | b7b331ad0dd061b55435265009af51cdeef29fdc (diff) |
Preserve newlines in delete & redraft and desktop notifications (#7750)
Fix #7748
Diffstat (limited to 'app/javascript/mastodon/utils')
-rw-r--r-- | app/javascript/mastodon/utils/html.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/app/javascript/mastodon/utils/html.js b/app/javascript/mastodon/utils/html.js index 0b646ce58..5159df9db 100644 --- a/app/javascript/mastodon/utils/html.js +++ b/app/javascript/mastodon/utils/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; }; |