summaryrefslogtreecommitdiff
path: root/Libraries/LibMarkdown
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-10-13 12:58:56 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-10-13 12:58:56 +0200
commit517e78a7e245c5b05e6e8c3c2b75bb35d23ccdfb (patch)
tree45d5f252acee599d33a94dad4dcddcdf73fdd62d /Libraries/LibMarkdown
parent2c035f50728f5c8b0d0b993148dc8f731e6d2332 (diff)
downloadserenity-517e78a7e245c5b05e6e8c3c2b75bb35d23ccdfb.zip
LibMarkdown: Emit properly formed HTML documents
Diffstat (limited to 'Libraries/LibMarkdown')
-rw-r--r--Libraries/LibMarkdown/MDDocument.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Libraries/LibMarkdown/MDDocument.cpp b/Libraries/LibMarkdown/MDDocument.cpp
index 21b2f2a3e1..69d4de9905 100644
--- a/Libraries/LibMarkdown/MDDocument.cpp
+++ b/Libraries/LibMarkdown/MDDocument.cpp
@@ -9,11 +9,17 @@ String MDDocument::render_to_html() const
{
StringBuilder builder;
+ builder.append("<!DOCTYPE html>\n");
+ builder.append("<html>\n");
+ builder.append("<body>\n");
+
for (auto& block : m_blocks) {
auto s = block.render_to_html();
builder.append(s);
}
+ builder.append("</body>\n");
+ builder.append("</html>\n");
return builder.build();
}