commits: Replace newlines in commit message with <br>.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
tastytea 2021-04-21 12:13:06 +02:00
parent f869ed9df2
commit 23031b0dc9
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 8 additions and 1 deletions

View File

@ -54,8 +54,15 @@ uint8_t write_commits(const string &url)
for (const Json::Value &commit : json)
{
const string sha = commit["sha"].asString();
const string message = commit["commit"]["message"].asString();
string message = commit["commit"]["message"].asString();
const string title = message.substr(0, message.find('\n'));
{
size_t pos{};
while ((pos = message.find('\n')) != string::npos)
{
message.replace(pos, 1, "<br>");
}
}
const string commit_url = commit["html_url"].asString();
const string author = commit["commit"]["author"]["email"].asString()
+ " ("