1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:57:35 +00:00

LibMarkdown: Emit properly formed HTML documents

This commit is contained in:
Andreas Kling 2019-10-13 12:58:56 +02:00
parent 2c035f5072
commit 517e78a7e2

View file

@ -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();
}