Fix custom emoji before a newline.
This commit is contained in:
parent
ec76a4c0bb
commit
2bec778251
1 changed files with 8 additions and 2 deletions
|
|
@ -204,9 +204,12 @@ public:
|
||||||
TagAccumulator(TextWithTags::Tags &tags) : _tags(tags) {
|
TagAccumulator(TextWithTags::Tags &tags) : _tags(tags) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool changed() const {
|
[[nodiscard]] bool changed() const {
|
||||||
return _changed;
|
return _changed;
|
||||||
}
|
}
|
||||||
|
[[nodiscrd]] QString currentTag() const {
|
||||||
|
return _currentTagId;
|
||||||
|
}
|
||||||
|
|
||||||
void feed(const QString &randomTagId, int currentPosition) {
|
void feed(const QString &randomTagId, int currentPosition) {
|
||||||
if (randomTagId == _currentTagId) {
|
if (randomTagId == _currentTagId) {
|
||||||
|
|
@ -214,7 +217,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_currentTagId.isEmpty()) {
|
if (!_currentTagId.isEmpty()) {
|
||||||
const auto tag = TextWithTags::Tag {
|
const auto tag = TextWithTags::Tag{
|
||||||
_currentStart,
|
_currentStart,
|
||||||
currentPosition - _currentStart,
|
currentPosition - _currentStart,
|
||||||
_currentTagId
|
_currentTagId
|
||||||
|
|
@ -2186,6 +2189,9 @@ QString InputField::getTextPart(
|
||||||
|
|
||||||
block = block.next();
|
block = block.next();
|
||||||
if (block != till) {
|
if (block != till) {
|
||||||
|
tagAccumulator.feed(
|
||||||
|
TagWithoutCustomEmoji(tagAccumulator.currentTag()),
|
||||||
|
result.size());
|
||||||
result.append('\n');
|
result.append('\n');
|
||||||
markdownTagAccumulator.feed(newline, 1, lastTag);
|
markdownTagAccumulator.feed(newline, 1, lastTag);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue