1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:57:45 +00:00

LibMarkdown: Add a Text(String) constructor

This commit is contained in:
AnotherTest 2020-09-20 18:06:40 +04:30 committed by Andreas Kling
parent 445bd86533
commit 7640cb8ec4
2 changed files with 6 additions and 0 deletions

View file

@ -47,6 +47,11 @@ static String unescape(const StringView& text)
return builder.build(); return builder.build();
} }
Text::Text(String&& text)
{
m_spans.append({ move(text), Style {} });
}
String Text::render_to_html() const String Text::render_to_html() const
{ {
StringBuilder builder; StringBuilder builder;

View file

@ -49,6 +49,7 @@ public:
Style style; Style style;
}; };
explicit Text(String&& text);
Text(Text&& text) = default; Text(Text&& text) = default;
Text() = default; Text() = default;