1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 01:04:59 +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:
FalseHonesty 2020-05-11 13:55:31 -04:00 committed by Andreas Kling
parent 9a2177437b
commit 7ca562b200
8 changed files with 28 additions and 28 deletions

View file

@ -560,9 +560,9 @@ void TextEditorWidget::set_markdown_preview_enabled(bool enabled)
void TextEditorWidget::update_markdown_preview()
{
Markdown::Document document;
if (document.parse(m_editor->text())) {
auto html = document.render_to_html();
auto document = Markdown::Document::parse(m_editor->text());
if (document) {
auto html = document->render_to_html();
auto html_document = Web::parse_html_document(html, URL::create_with_file_protocol(m_path));
m_page_view->set_document(html_document);
}