Fix converting entities to tags.
This commit is contained in:
parent
a009efc50d
commit
0134685622
1 changed files with 5 additions and 3 deletions
|
|
@ -2060,8 +2060,8 @@ QString TagWithRemoved(const QString &tag, const QString &removed) {
|
|||
}
|
||||
|
||||
QString TagWithAdded(const QString &tag, const QString &added) {
|
||||
if (tag == added) {
|
||||
return tag;
|
||||
if (tag.isEmpty() || tag == added) {
|
||||
return added;
|
||||
}
|
||||
auto list = tag.splitRef('|');
|
||||
const auto ref = added.midRef(0);
|
||||
|
|
@ -2227,7 +2227,9 @@ TextWithTags::Tags ConvertEntitiesToTextTags(
|
|||
if (next == current) {
|
||||
return;
|
||||
} else if (nextOffset > offset) {
|
||||
if (!current.isEmpty()) {
|
||||
result.push_back({ offset, nextOffset - offset, current });
|
||||
}
|
||||
offset = nextOffset;
|
||||
}
|
||||
current = next;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue