| 65 | } |
| 66 | |
| 67 | void HyperTextBox::parseParagraph(Widget* _parent, std::string_view _value) |
| 68 | { |
| 69 | auto textItem = _value.end(); |
| 70 | for (auto item = _value.begin(); item != _value.end(); ++item) |
| 71 | { |
| 72 | if ((*item) == '<') |
| 73 | { |
| 74 | // отрезаем текст |
| 75 | if (textItem < item) |
| 76 | { |
| 77 | if (mCurrentWrapPanel != nullptr) |
| 78 | parseText(mCurrentWrapPanel, _value.substr(textItem - _value.begin(), item - textItem)); |
| 79 | } |
| 80 | |
| 81 | // ищем конец тега |
| 82 | for (auto tagItem = item; tagItem != _value.end(); ++tagItem) |
| 83 | { |
| 84 | if ((*tagItem) == '>') |
| 85 | { |
| 86 | parseTag(_value.substr(item - _value.begin(), tagItem - item + 1)); |
| 87 | |
| 88 | item = tagItem; |
| 89 | textItem = tagItem + 1; |
| 90 | break; |
| 91 | } |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | void HyperTextBox::parseText(Widget* _parent, std::string_view _value) |
| 98 | { |