diff --git a/src/main.cpp b/src/main.cpp
index dd2b4b9..49c75b1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -38,6 +38,7 @@ using std::endl;
using std::string;
using std::ostringstream;
using std::stringstream;
+using std::uint8_t;
using std::uint16_t;
using std::chrono::system_clock;
@@ -105,6 +106,25 @@ const string strtime(const string &time)
return strtime(std::chrono::system_clock::from_time_t(std::mktime(&tm)));
}
+void write_line(const uint8_t spaces, const string &tag, const string &value)
+{
+ string endtag;
+ // If there is a space in the tag, use only the part up until the space for
+ // the ending tag.
+ const size_t pos = tag.find(' ');
+ if (pos == std::string::npos)
+ {
+ endtag = tag;
+ }
+ else
+ {
+ endtag = tag.substr(0, pos);
+ }
+
+ cout << std::string(spaces, ' ');
+ cout << '<' << tag << '>' << value << "" << endtag << ">\n";
+}
+
int main(int argc, char *argv[])
{
const char *envquery = std::getenv("QUERY_STRING");
@@ -177,20 +197,17 @@ int main(int argc, char *argv[])
{
const bool prerelease = release["prerelease"].asBool();
const string type = (prerelease ? "Pre-Release" : "Stable");
- cout <<
- "
\n" << release["body"].asString() << "\n" - << "Download tarball" << "]]>\n"; - + cout << "
\n" + + release["body"].asString() + "\n" + "Download tarball" + "]]>"); cout << "