NOW MANAGED ON CODEBERG
Fixed issue where text after line breaks not indexed
Dan Brown0c6f598d9172
diff --git a/app/Entities/Tools/SearchIndex.php b/app/Entities/Tools/SearchIndex.phpindex d43d98207..db44daadf 100644--- a/app/Entities/Tools/SearchIndex.php+++ b/app/Entities/Tools/SearchIndex.php@@ -147,6 +147,8 @@ class SearchIndex];$html = '<body>' . $html . '</body>';+ $html = str_ireplace(['<br>', '<br />', '<br/>'], "\n", $html);+libxml_use_internal_errors(true);$doc = new DOMDocument();$doc->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'));diff --git a/tests/Entity/EntitySearchTest.php b/tests/Entity/EntitySearchTest.phpindex ab5777e98..b535f5aaa 100644--- a/tests/Entity/EntitySearchTest.php+++ b/tests/Entity/EntitySearchTest.php@@ -423,6 +423,17 @@ class EntitySearchTest extends TestCase$search->assertSee('My supercool <great> <strong>TestPageContent</strong> page', false);}+ public function test_words_adjacent_to_lines_breaks_can_be_matched_with_normal_terms()+ {+ $page = $this->newPage(['name' => 'TermA', 'html' => '+ <p>TermA<br>TermB<br>TermC</p>+ ']);++ $search = $this->asEditor()->get('/search?term=' . urlencode('TermB TermC'));++ $search->assertSee($page->getUrl(), false);+ }+public function test_searches_with_user_filters_adds_them_into_advanced_search_form(){$resp = $this->asEditor()->get('/search?term=' . urlencode('test {updated_by:me} {created_by:dan}'));