1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2024-10-30 07:32:39 +01:00

Added test case for multibyte search highlighting

Related to #3113
This commit is contained in:
Dan Brown 2021-12-18 10:38:33 +00:00
parent 632cb71af4
commit c6e3e85e82
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9

View File

@ -403,6 +403,17 @@ class EntitySearchTest extends TestCase
$search->assertElementContains('.tag-value.highlight', 'MeowieCat');
}
public function test_match_highlighting_works_with_multibyte_content()
{
$this->newPage([
'name' => 'Test Page',
'html' => '<p>На мен ми трябва нещо добро test</p>'
]);
$search = $this->asEditor()->get('/search?term=' . urlencode('На мен ми трябва нещо добро'));
$search->assertSee('<strong>На</strong> <strong>мен</strong> <strong>ми</strong> <strong>трябва</strong> <strong>нещо</strong> <strong>добро</strong> test', false);
}
public function test_html_entities_in_item_details_remains_escaped_in_search_results()
{
$this->newPage(['name' => 'My <cool> TestPageContent', 'html' => '<p>My supercool &lt;great&gt; TestPageContent page</p>']);