[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [BP][FIX] Tracker Items: Search usability – h ighlight query words in related task titles

"ushindi bienvenu \(@usbbush\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68ef692c54459_2cd457602660@gitlab-sidekiq-low-urgency-cpu-bound-v2-646f46c745-h6s24.mail>

ushindi bienvenu pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
0d5112ef by David Maene at 2025-10-15T09:21:43+00:00
[BP][FIX] Tracker Items: Search usability – highlight query words in related task titles
---
* [FIX] Tracker Items: Search usability – highlight query words in related task titles
---
* Search usability – highlight query words in related task titles

See merge request tikiwiki/tiki!8598

See merge request tikiwiki/tiki!8740

- - - - -


1 changed file:

- lib/core/Search/MySql/HighlightHelper.php


Changes:

=====================================
lib/core/Search/MySql/HighlightHelper.php
=====================================
@@ -16,11 +16,15 @@ class Search_MySql_HighlightHelper implements Laminas\Filter\FilterInterface
             return strlen($word) > 2;
         });
 
-        $counter = -1;
+        $this->words = array_map(function ($word) {
+            return trim($word, '*');
+        }, $this->words);
 
+        $counter = -1;
         $this->replacements = array_map(
             function ($word) use (&$counter) {
-                $counter++;
+                ++$counter;
+
                 return "<b class=\"highlight_word highlight_word_$counter\">$word</b>";
             },
             $this->words
@@ -32,6 +36,7 @@ class Search_MySql_HighlightHelper implements Laminas\Filter\FilterInterface
     {
         $content = $this->snippetHelper->filter($content);
         $content = str_ireplace($this->words, $this->replacements, $content);
+
         return trim(strip_tags($content, '<b><i><em><strong><pre><code><span>'));
     }
 }



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/0d5112ef1ba2db7ed0249db7173f1187568fcefa

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/0d5112ef1ba2db7ed0249db7173f1187568fcefa
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.