remove trailing newlines in description

This commit is contained in:
tastytea 2018-04-16 21:05:46 +02:00
parent a621d29b9e
commit 3e2f81131c
Signed by: tastytea
GPG Key ID: 59346E0EA35C67E5
2 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.7)
project (mastorss
VERSION 0.5.5
VERSION 0.5.6
LANGUAGES CXX
)

View File

@ -173,6 +173,12 @@ std::vector<string> parse_website(const string &xml)
str.resize(str.rfind(' ')); // Cut at word boundary
str += " […]";
}
// Remove trailing newlines
while (str.back() == '\n' ||
str.back() == '\r')
{
str.resize(str.length() - 1);
}
str += "\n\n" + link + "\n\n#bot";
ret.push_back(str);
}