Fix custom emoji before a newline.

This commit is contained in:
John Preston 2022-07-06 10:41:30 +04:00
parent ec76a4c0bb
commit 2bec778251

View file

@ -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);
}