mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-30 07:32:39 +01:00
Moved decode and updated page plaintext decode test
This commit is contained in:
parent
44f3508171
commit
31eec34b5d
@ -25,7 +25,7 @@ class PageContent
|
||||
public function setNewHTML(string $html)
|
||||
{
|
||||
$this->page->html = $this->formatHtml($html);
|
||||
$this->page->text = html_entity_decode($this->toPlainText());
|
||||
$this->page->text = $this->toPlainText();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -108,7 +108,7 @@ class PageContent
|
||||
protected function toPlainText(): string
|
||||
{
|
||||
$html = $this->render(true);
|
||||
return strip_tags($html);
|
||||
return html_entity_decode(strip_tags($html));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -312,10 +312,10 @@ class PageContentTest extends TestCase
|
||||
$this->actingAs($this->getAdmin())
|
||||
->put($page->getUrl(''), [
|
||||
'name' => 'Testing',
|
||||
'html' => '<p>Hello & welcome</p>',
|
||||
'html' => '<p>"Hello & welcome"</p>',
|
||||
]);
|
||||
|
||||
$page->refresh();
|
||||
$this->assertEquals('Hello & welcome', $page->text);
|
||||
$this->assertEquals('"Hello & welcome"', $page->text);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user