mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-04-30 16:14:04 +08:00
Page nav: Fixed nbsp being represented as nothing
Now represented in page nav using a normal space to avoid complete removal of space. Added test to cover. For #4836
This commit is contained in:
parent
b7d4bd5bce
commit
77f125208e
@ -469,6 +469,20 @@ class PageContentTest extends TestCase
|
|||||||
], $navMap[2]);
|
], $navMap[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_get_page_nav_respects_non_breaking_spaces()
|
||||||
|
{
|
||||||
|
$content = '<h1 id="testa">Hello There</h1>';
|
||||||
|
$pageContent = new PageContent(new Page(['html' => $content]));
|
||||||
|
$navMap = $pageContent->getNavigation($content);
|
||||||
|
|
||||||
|
$this->assertEquals([
|
||||||
|
'nodeName' => 'h1',
|
||||||
|
'link' => '#testa',
|
||||||
|
'text' => 'Hello There',
|
||||||
|
'level' => 1,
|
||||||
|
], $navMap[0]);
|
||||||
|
}
|
||||||
|
|
||||||
public function test_page_text_decodes_html_entities()
|
public function test_page_text_decodes_html_entities()
|
||||||
{
|
{
|
||||||
$page = $this->entities->page();
|
$page = $this->entities->page();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user