0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 07:23:53 +01:00

modules/web_hook: Replace and fix multi-line content formattings.

This commit is contained in:
Jason Volk 2020-05-11 16:28:23 -07:00
parent db4e0af8a9
commit 28c630268c

View file

@ -419,16 +419,11 @@ github_handle__gollum(std::ostream &out,
static const auto delim("\\r\\n");
const json::string body(page["summary"]);
auto lines(split(body, delim)); do
ircd::tokens(body, delim, [&out]
(const string_view &line)
{
out
<< lines.first
<< "<br />"
;
lines = split(lines.second, delim);
}
while(!empty(lines.second));
out << line << "<br />";
});
out
<< ""
@ -871,15 +866,11 @@ github_handle__issues(std::ostream &out,
static const auto delim("\\r\\n");
const json::string body(issue["body"]);
auto lines(split(body, delim)); do
ircd::tokens(body, delim, [&out]
(const string_view &line)
{
out << lines.first
<< "<br />"
;
lines = split(lines.second, delim);
}
while(!empty(lines.second));
out << line << "<br />";
});
out << ""
<< "</code></pre>"
@ -1058,15 +1049,11 @@ github_handle__issue_comment(std::ostream &out,
static const auto delim("\\r\\n");
const json::string body(comment["body"]);
auto lines(split(body, delim)); do
ircd::tokens(body, delim, [&out]
(const string_view &line)
{
out << lines.first
<< "\\n"
;
lines = split(lines.second, delim);
}
while(!empty(lines.second));
out << line << "<br />";
});
out << ""
<< "</code></pre>"