mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 09:46:04 -05:00
LibMarkdown: Add a Text(String) constructor
This commit is contained in:
parent
445bd86533
commit
7640cb8ec4
Notes:
sideshowbarker
2024-07-19 02:09:39 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/7640cb8ec41 Pull-request: https://github.com/SerenityOS/serenity/pull/3562 Reviewed-by: https://github.com/bugaevc
2 changed files with 6 additions and 0 deletions
|
@ -47,6 +47,11 @@ static String unescape(const StringView& text)
|
|||
return builder.build();
|
||||
}
|
||||
|
||||
Text::Text(String&& text)
|
||||
{
|
||||
m_spans.append({ move(text), Style {} });
|
||||
}
|
||||
|
||||
String Text::render_to_html() const
|
||||
{
|
||||
StringBuilder builder;
|
||||
|
|
|
@ -49,6 +49,7 @@ public:
|
|||
Style style;
|
||||
};
|
||||
|
||||
explicit Text(String&& text);
|
||||
Text(Text&& text) = default;
|
||||
Text() = default;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue