From a140a6b5b3a7fb3a0ca5eaca371cbc1a43bc224e Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 28 Feb 2018 20:46:56 +0100 Subject: [PATCH] Better newline reduction (hopefully) --- CMakeLists.txt | 2 +- src/parse.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ac6b63..1581351 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project (mastorss - VERSION 0.3.2 + VERSION 0.3.4 LANGUAGES CXX ) diff --git a/src/parse.cpp b/src/parse.cpp index 72db500..87a1e0e 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -147,8 +147,8 @@ std::vector parse_website(const string &profile, const string &xml) str = std::regex_replace(str, reindyfuckup, ""); str = std::regex_replace(str, redaclosing, ""); str = std::regex_replace(str, reggboclosing, ""); - str = std::regex_replace(str, std::regex("\\n \\n]"), "\n\n"); // remove space between newlines - str = std::regex_replace(str, std::regex("[\\n\\r ]{3,}"), "\n"); // remove excess newlines + str = std::regex_replace(str, std::regex("[\\r\\n] [\\r\\n]"), "\n\n"); // remove space between newlines + str = std::regex_replace(str, std::regex("[\\r\\n]{3,}"), "\n"); // remove excess newlines for (const string &hashtag : watchwords) {