summaryrefslogtreecommitdiff
path: root/src/html_formatter.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/html_formatter.cc')
-rw-r--r--src/html_formatter.cc19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/html_formatter.cc b/src/html_formatter.cc
index 0e796cc3..6b5930d2 100644
--- a/src/html_formatter.cc
+++ b/src/html_formatter.cc
@@ -23,7 +23,9 @@
#include <boost/filesystem.hpp>
+using std::string;
using std::unique_ptr;
+using std::vector;
using namespace dcp;
@@ -95,13 +97,24 @@ HTMLFormatter::unordered_list()
void
-HTMLFormatter::list_item(std::string const& text, boost::optional<std::string> type)
+HTMLFormatter::list_item(std::string const& text, boost::optional<std::string> type, vector<string> const& details)
{
if (type) {
- _file.puts(dcp::String::compose("<li class=\"%1\">%2</li>\n", *type, text).c_str());
+ _file.puts(dcp::String::compose("<li class=\"%1\">%2", *type, text).c_str());
} else {
- _file.puts(dcp::String::compose("<li>%1</li>\n", text).c_str());
+ _file.puts(dcp::String::compose("<li>%1", text).c_str());
}
+
+ if (!details.empty())
+ {
+ _file.puts("<ol>\n");
+ for (auto const& detail: details) {
+ _file.puts(fmt::format("<li>{}", detail).c_str());
+ }
+ _file.puts("</ol>\n");
+ }
+
+ _file.puts("</li>\n");
}