mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-24 11:21:34 +00:00
LibMarkdown: Emit properly formed HTML documents
This commit is contained in:
parent
2c035f5072
commit
517e78a7e2
Notes:
sideshowbarker
2024-07-19 11:42:45 +09:00
Author: https://github.com/awesomekling
Commit: 517e78a7e2
1 changed files with 6 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue