mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 05:14:58 +00:00
LibMarkdown: Change MD Document parse API to return a RefPtr
Markdown documents are now obtained via the static Document::parse method, which returns a RefPtr<Document>, or nullptr on failure.
This commit is contained in:
parent
9a2177437b
commit
7ca562b200
8 changed files with 28 additions and 28 deletions
|
@ -128,11 +128,10 @@ int main(int argc, char* argv[])
|
|||
auto buffer = file->read_all();
|
||||
StringView source { (const char*)buffer.data(), buffer.size() };
|
||||
|
||||
Markdown::Document md_document;
|
||||
bool success = md_document.parse(source);
|
||||
ASSERT(success);
|
||||
auto md_document = Markdown::Document::parse(source);
|
||||
ASSERT(md_document);
|
||||
|
||||
String 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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue