chibenwa commented on code in PR #2583:
URL: https://github.com/apache/james-project/pull/2583#discussion_r1905137556


##########
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/search/OpenSearchSearchHighlighter.java:
##########
@@ -100,6 +97,21 @@ private SearchSnippet buildSearchSnippet(Hit<ObjectNode> 
searchResult) {
     }
 
     private String shortenGreaterThanCharacters(String text) {
-        return GREATER_THAN_PATTERN.matcher(text).replaceAll(">");
+        StringBuilder result = new StringBuilder();
+        boolean previousIsTarget = false;
+
+        for (char c : text.toCharArray()) {

Review Comment:
   I am a fan of neither of both approaches to be fairly honnest..



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org

Reply via email to