mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-05-07 01:41:12 +08:00
19 lines
351 B
C++
19 lines
351 B
C++
![]() |
#include <sstream>
|
||
|
#include "ftxui/dom/elements.hpp"
|
||
|
|
||
|
namespace ftxui {
|
||
|
|
||
|
Elements paragraph(std::wstring the_text) {
|
||
|
Elements output;
|
||
|
std::wstringstream ss(the_text);
|
||
|
std::wstring word;
|
||
|
while (std::getline(ss, word, L' ')) {
|
||
|
if (word.size()) {
|
||
|
output.push_back(text(word + L' '));
|
||
|
}
|
||
|
}
|
||
|
return output;
|
||
|
}
|
||
|
|
||
|
} // namespace ftxui
|