diff --git a/CMakeLists.txt b/CMakeLists.txt index f949ce7..b97ff60 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.6) project (mastorss - VERSION 0.7.6 + VERSION 0.7.7 LANGUAGES CXX ) diff --git a/src/parse.cpp b/src/parse.cpp index aec953c..390c1b0 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -155,8 +155,9 @@ std::vector parse_website(const string &xml) for (const string &hashtag : watchwords) { - std::regex rehashtag("([[:space:][:punct:]]|^)(" + hashtag + - ")([[:space:][:punct:]]|$)", std::regex_constants::icase); + std::regex rehashtag("([[:space:][:punct:]]|^)(" + hashtag + + ")([[:space:][:punct:]]|$)", + std::regex_constants::icase); content = std::regex_replace(content, rehashtag, "$1#$2$3", std::regex_constants::format_first_only); } @@ -167,7 +168,8 @@ std::vector parse_website(const string &xml) if ((status.spoiler_text().size() + content.size() + link.size() + appendix_size) > static_cast(max_size - 4)) { - content.resize((max_size - link.size() - appendix_size - 4)); + content.resize((max_size - status.spoiler_text().size() + - link.size() - appendix_size - 4)); content.resize(content.rfind(' ')); // Cut at word boundary content += " […]"; }