mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-14 03:45:54 +00:00
Highlighting search results: Added heuristic approach for common capitalizations, fixed indentions
This commit is contained in:
@@ -2864,7 +2864,11 @@
|
||||
|
||||
// http://stackoverflow.com/questions/4081372/highlight-keywords-in-a-paragraph
|
||||
|
||||
$elements = $xpath->query('//*[contains(.,"'.$word.'")]');
|
||||
$also_query = '';
|
||||
foreach(array(strtolower($word), strtoupper($word), ucfirst(strtolower($word))) as $word_cap) {
|
||||
$also_query .= ' or contains(.,"'.$word_cap.'")' ;
|
||||
}
|
||||
$elements = $xpath->query('//*[contains(.,"'.$word.'")' . $also_query . ']');
|
||||
|
||||
foreach ($elements as $element) {
|
||||
foreach ($element->childNodes as $child) {
|
||||
|
||||
Reference in New Issue
Block a user