diff --git a/CMakeLists.txt b/CMakeLists.txt index afb0159..6bf9248 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project (mastorss - VERSION 0.5.8 + VERSION 0.5.9 LANGUAGES CXX ) diff --git a/src/parse.cpp b/src/parse.cpp index 519ff12..b6b09b6 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -158,7 +158,7 @@ std::vector parse_website(const string &xml) str = std::regex_replace(str, std::regex("\\r"), ""); // remove \r str = std::regex_replace(str, std::regex("\\n +\\n"), "\n\n"); // remove space between newlines str = std::regex_replace(str, std::regex("\\n{3,}"), "\n\n"); // remove excess newlines - str = std::regex_replace(str, std::regex("\\n[ \t]*\\n"), ""); // remove nothing + str = std::regex_replace(str, std::regex("\\n[ \t]+\\n"), ""); // remove nothing for (const string &hashtag : watchwords) { @@ -169,7 +169,7 @@ std::vector parse_website(const string &xml) } // Why is this necessary? Why does ##hashtag happen? str = std::regex_replace(str, std::regex("##"), "#"); - if ((str.size() + link.size()) > (std::uint16_t)(max_size - 15)) + if ((str.size() + link.size()) > static_cast(max_size - 15)) { str.resize((max_size - link.size() - 15)); str.resize(str.rfind(' ')); // Cut at word boundary