diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-10-13 12:58:56 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-10-13 12:58:56 +0200 |
commit | 517e78a7e245c5b05e6e8c3c2b75bb35d23ccdfb (patch) | |
tree | 45d5f252acee599d33a94dad4dcddcdf73fdd62d /Libraries/LibMarkdown | |
parent | 2c035f50728f5c8b0d0b993148dc8f731e6d2332 (diff) | |
download | serenity-517e78a7e245c5b05e6e8c3c2b75bb35d23ccdfb.zip |
LibMarkdown: Emit properly formed HTML documents
Diffstat (limited to 'Libraries/LibMarkdown')
-rw-r--r-- | Libraries/LibMarkdown/MDDocument.cpp | 6 |
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(); } |