Add unicode char c2a0 to list of whitespace to remove

This commit is contained in:
tastytea 2018-04-25 16:37:11 +02:00
parent 61df4cdff1
commit 393d1df378
Signed by: tastytea
GPG Key ID: 59346E0EA35C67E5
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.7)
project (mastorss
VERSION 0.5.9
VERSION 0.5.10
LANGUAGES CXX
)

View File

@ -155,9 +155,9 @@ std::vector<string> parse_website(const string &xml)
str = std::regex_replace(str, recdata1, "");
str = std::regex_replace(str, recdata2, "");
str = std::regex_replace(str, restrip, "");
str = std::regex_replace(str, std::regex("\\r"), ""); // remove \r
str = std::regex_replace(str, std::regex("\\n[ \t]+\\n"), ""); // remove whitespace between newlines
str = std::regex_replace(str, std::regex("\\n{3,}"), "\n\n"); // remove excess newlines
str = std::regex_replace(str, std::regex("\\r"), ""); // remove \r
str = std::regex_replace(str, std::regex("\\n[ \uc2a0\t]+\\n"), ""); // remove whitespace between newlines
str = std::regex_replace(str, std::regex("\\n{3,}"), "\n\n"); // remove excess newlines
for (const string &hashtag : watchwords)
{