Remove Pre tag when removing Code tag.
This commit is contained in:
parent
c25c3e043c
commit
3668ee1085
1 changed files with 10 additions and 2 deletions
|
|
@ -3312,8 +3312,16 @@ void InputField::removeMarkdownTag(
|
||||||
auto tags = TagList();
|
auto tags = TagList();
|
||||||
for (const auto &existing : current.tags) {
|
for (const auto &existing : current.tags) {
|
||||||
const auto id = TextUtilities::TagWithRemoved(existing.id, tag);
|
const auto id = TextUtilities::TagWithRemoved(existing.id, tag);
|
||||||
if (!id.isEmpty()) {
|
const auto additional = (tag == kTagPre)
|
||||||
tags.push_back({ existing.offset, existing.length, id });
|
? kTagCode
|
||||||
|
: (tag == kTagCode)
|
||||||
|
? kTagPre
|
||||||
|
: QString();
|
||||||
|
const auto use = additional.isEmpty()
|
||||||
|
? id
|
||||||
|
: TextUtilities::TagWithRemoved(id, additional);
|
||||||
|
if (!use.isEmpty()) {
|
||||||
|
tags.push_back({ existing.offset, existing.length, use });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue