From e556403154ca2e82f78d35413c5f9bf94b2a530f Mon Sep 17 00:00:00 2001 From: Brendan Hagan Date: Tue, 26 Jul 2022 22:41:10 -0400 Subject: [PATCH] misc: adjust text formatting in tagged_string --- src/util/tagged_string.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/util/tagged_string.cpp b/src/util/tagged_string.cpp index 9ad82a81..3be0e892 100644 --- a/src/util/tagged_string.cpp +++ b/src/util/tagged_string.cpp @@ -645,7 +645,10 @@ String simplify_tagged(const String& str) { // (where is the negation of tag) bool add_or_cancel_tag(const String& tag, String& stack, bool all = false) { if (all || starts_with(tag, _("/")) || - starts_with(tag, _("b")) || starts_with(tag, _("i")) || starts_with(tag, _("sym")) || starts_with(tag, _("u"))) { + starts_with(tag, _("b")) || + starts_with(tag, _("i")) || + starts_with(tag, _("u")) || + starts_with(tag, _("sym"))) { // cancel out all close tags, but not all open tags, // so is always removed // but is not @@ -692,8 +695,10 @@ String simplify_tagged_overlap(const String& str) { Char c = str.GetChar(i); if (c == _('<')) { String tag = tag_at(str, i); - if (starts_with(tag, _("b")) || starts_with(tag, _("i")) || starts_with(tag, _("sym")) || starts_with(tag, _("u")) || - starts_with(tag, _("/b")) || starts_with(tag, _("/i")) || starts_with(tag, _("/sym")) || starts_with(tag, _("/u"))) { + if (starts_with(tag, _("b")) || starts_with(tag, _("/b")) || + starts_with(tag, _("i")) || starts_with(tag, _("/i")) || + starts_with(tag, _("u")) || starts_with(tag, _("/u")) || + starts_with(tag, _("sym")) || starts_with(tag, _("/sym"))) { // optimize this tag if (open_tags.find(_("<") + tag + _(">")) == String::npos) { // we are not already inside this tag