mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-24 00:24:38 +00:00
LibMarkdown: Change internal MD API to return OwnPtrs
Previously, all Markdown blocks had a virtual parse method which has been swapped out for a static parse method returning an OwnPtr of that block's type. The Text class also now has a static parse method that will return an Optional<Text>.
This commit is contained in:
committed by
Andreas Kling
parent
7ca562b200
commit
20faa93cb0
@@ -128,10 +128,13 @@ int main(int argc, char* argv[])
|
||||
auto buffer = file->read_all();
|
||||
StringView source { (const char*)buffer.data(), buffer.size() };
|
||||
|
||||
auto md_document = Markdown::Document::parse(source);
|
||||
ASSERT(md_document);
|
||||
String html;
|
||||
{
|
||||
auto md_document = Markdown::Document::parse(source);
|
||||
ASSERT(md_document);
|
||||
html = md_document->render_to_html();
|
||||
}
|
||||
|
||||
String html = md_document->render_to_html();
|
||||
auto html_document = Web::parse_html_document(html);
|
||||
page_view.set_document(html_document);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user