Replace <br> with newline.

This commit is contained in:
tastytea 2021-07-12 23:35:42 +02:00
parent 59f0302281
commit 2ad4b46551
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07

View File

@ -1,5 +1,5 @@
/* This file is part of mastorss.
* Copyright © 2019, 2020 tastytea <tastytea@tastytea.de>
* Copyright © 2019-2021 tastytea <tastytea@tastytea.de>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -238,6 +238,7 @@ string Document::remove_html(string html) const
html = mastodonpp::unescape_html(html); // Decode HTML entities.
html = regex_replace(html, regex{"<p>"}, "\n\n");
html = regex_replace(html, regex{"<br>"}, "\n");
const list re_list{regex{R"(<!\[CDATA\[)"}, // CDATA beginning.
regex{R"(\]\]>)"}, // CDATA end.