[TikiWiki-commits] [Git][tikiwiki/tiki][master ] [FIX] Tracker Items: Search usability – highl ight query words in related task titles
Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <68d6c85c49555_2cdf908-398@gitlab-sidekiq-low-urgency-cpu-bound-v2-7f8dcfb496-qk6hz.mail> |
Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki
Commits:
5f7f2c62 by David Maene at 2025-09-26T16:59:21+00:00
[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
- - - - -
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/5f7f2c62d5dbcd16b9312a885d0648312cd6b2f2
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/5f7f2c62d5dbcd16b9312a885d0648312cd6b2f2
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