From: Vsevolod Stakhov Date: Mon, 5 Jul 2021 16:41:16 +0000 (+0100) Subject: [Project] Another whitespace hack X-Git-Tag: 3.0~211 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f35be29ff27442aeb78828150eda24cc2795bd1d;p=thirdparty%2Frspamd.git [Project] Another whitespace hack --- diff --git a/src/libserver/html/html.cxx b/src/libserver/html/html.cxx index b29a7d37db..f9aacaf0cf 100644 --- a/src/libserver/html/html.cxx +++ b/src/libserver/html/html.cxx @@ -1011,8 +1011,18 @@ html_append_content(struct html_content *hc, std::string_view data) -> auto { auto cur_offset = hc->parsed.size(); hc->parsed.append(data); + + if (cur_offset > 0 && data.size() > 0) { + auto last = hc->parsed.back(); + auto first_appended = data.front(); + if (first_appended == ' ' && !g_ascii_isspace(last)) { + cur_offset++; + } + } + auto nlen = decode_html_entitles_inplace(hc->parsed.data() + cur_offset, hc->parsed.size() - cur_offset, true); + hc->parsed.resize(nlen + cur_offset); return nlen;