diff --git a/libs/search/highlighting.cpp b/libs/search/highlighting.cpp index e8a3a85d7..3bed5d87d 100644 --- a/libs/search/highlighting.cpp +++ b/libs/search/highlighting.cpp @@ -1,4 +1,5 @@ #include "search/highlighting.hpp" +#include "std/target_os.hpp" namespace search { @@ -51,12 +52,11 @@ void HighlightResult(QueryTokens const & tokens, strings::UniString const & pref std::string titleForHighlighting = res.GetString(); std::string const & branch = res.GetBranch(); - // If we have a branch that is not already in the title, create combined string for highlighting - // This matches the iOS UI behavior where branch is appended as " branchText" + // On iOS we append branch text to the title for highlighting if it's not already present. +#if defined(OMIM_OS_IPHONE) if (!branch.empty() && titleForHighlighting.find(branch) == std::string::npos) - { titleForHighlighting += " " + branch; - } +#endif SearchStringTokensIntersectionRanges( titleForHighlighting, beg, end, [&](std::pair const & range) { res.AddHighlightRange(range); });