diff --git a/ui/widgets/input_fields.cpp b/ui/widgets/input_fields.cpp index 8a87c91..6e103b7 100644 --- a/ui/widgets/input_fields.cpp +++ b/ui/widgets/input_fields.cpp @@ -204,9 +204,12 @@ public: TagAccumulator(TextWithTags::Tags &tags) : _tags(tags) { } - bool changed() const { + [[nodiscard]] bool changed() const { return _changed; } + [[nodiscrd]] QString currentTag() const { + return _currentTagId; + } void feed(const QString &randomTagId, int currentPosition) { if (randomTagId == _currentTagId) { @@ -214,7 +217,7 @@ public: } if (!_currentTagId.isEmpty()) { - const auto tag = TextWithTags::Tag { + const auto tag = TextWithTags::Tag{ _currentStart, currentPosition - _currentStart, _currentTagId @@ -2186,6 +2189,9 @@ QString InputField::getTextPart( block = block.next(); if (block != till) { + tagAccumulator.feed( + TagWithoutCustomEmoji(tagAccumulator.currentTag()), + result.size()); result.append('\n'); markdownTagAccumulator.feed(newline, 1, lastTag); }