1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:14:58 +00:00

LibMarkdown: Convert render_to_terminal to String

This commit converts render_to_terminal from DeprecatedString to return
an ErrorOr<String>. This is to aid moving `man` away from
DeprecatedString.

I have opted not to convert render_to_html and render_to_inline_html for
now to keep this commit as small as possible.
This commit is contained in:
Carwyn Nelson 2023-06-13 16:15:13 +01:00 committed by Jelle Raaijmakers
parent e247da507f
commit e44abaa777
4 changed files with 14 additions and 8 deletions

View file

@ -56,7 +56,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
return 1;
}
DeprecatedString res = html ? document->render_to_html() : document->render_for_terminal(view_width);
out("{}", res);
if (html) {
out("{}", document->render_to_html());
} else {
out("{}", TRY(document->render_for_terminal(view_width)));
}
return 0;
}