summaryrefslogtreecommitdiff
path: root/DevTools/HackStudio
diff options
context:
space:
mode:
authorFalseHonesty <thefalsehonesty@gmail.com>2020-05-11 13:55:31 -0400
committerAndreas Kling <kling@serenityos.org>2020-05-30 00:32:12 +0200
commit7ca562b200e9a15bc02bdd23f5c9faedf53e6a26 (patch)
treeac910d25df68cf9145b7e9123daebe5a54f30a4c /DevTools/HackStudio
parent9a2177437bd197fc53cb1296a52f13afb5c64475 (diff)
downloadserenity-7ca562b200e9a15bc02bdd23f5c9faedf53e6a26.zip
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.
Diffstat (limited to 'DevTools/HackStudio')
-rw-r--r--DevTools/HackStudio/Editor.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/DevTools/HackStudio/Editor.cpp b/DevTools/HackStudio/Editor.cpp
index 6383cb90cd..697d811ceb 100644
--- a/DevTools/HackStudio/Editor.cpp
+++ b/DevTools/HackStudio/Editor.cpp
@@ -169,15 +169,14 @@ void Editor::show_documentation_tooltip_if_available(const String& hovered_token
return;
}
- Markdown::Document man_document;
- bool success = man_document.parse(file->read_all());
+ auto man_document = Markdown::Document::parse(file->read_all());
- if (!success) {
+ if (!man_document) {
dbg() << "failed to parse markdown";
return;
}
- auto html_text = man_document.render_to_html();
+ auto html_text = man_document->render_to_html();
auto html_document = Web::parse_html_document(html_text);
if (!html_document) {