From ede97e65fe6e01cfbd02af0575292f6c91f055e9 Mon Sep 17 00:00:00 2001 From: tastytea Date: Thu, 26 Apr 2018 15:50:42 +0200 Subject: [PATCH] replace NO-BREAK SPACE with space --- CMakeLists.txt | 2 +- src/parse.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 398b22a..5b07739 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project (mastorss - VERSION 0.5.10 + VERSION 0.5.11 LANGUAGES CXX ) diff --git a/src/parse.cpp b/src/parse.cpp index b2e1819..b3fee77 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -155,9 +155,10 @@ std::vector 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[ \uc2a0\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("\uc2a0"), " "); // replace NO-BREAK SPACE with space + 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 for (const string &hashtag : watchwords) {