From a81a200e9f60ddf47225c339f450a95523078bc9 Mon Sep 17 00:00:00 2001 From: tastytea Date: Thu, 22 Feb 2018 16:48:50 +0100 Subject: [PATCH] Made sure the description isn't interrupted mid-word --- CMakeLists.txt | 2 +- src/parse.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1815dd5..4045451 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project (mastorss - VERSION 0.3.0 + VERSION 0.3.1 LANGUAGES CXX ) diff --git a/src/parse.cpp b/src/parse.cpp index a622515..543a12e 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -152,6 +152,7 @@ std::vector parse_website(const string &profile, const string &xml) if ((str.size() + link.size()) > (std::uint16_t)(max_size - 15)) { str.resize((max_size - link.size() - 15)); + str.resize(str.rfind(' ')); str += " […]"; } str += "\n\n" + link + "\n\n#bot";