mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Aligned some editor events, Changed wysiwyg custom styles loading
- Removed old 'editor-*-update' commands to instead use the aligned 'editor::replace' command that we already have. - Changed the way custom styles are loaded for the WYSIWYG editor so we don't need an API call but instead scape content from the parent page header using comments as identifiers. Added tests to ensure comments exist and align.
This commit is contained in:
@ -14,6 +14,15 @@ class CustomHeadContentTest extends TestCase
|
||||
$resp->assertSee('console.log("cat")', false);
|
||||
}
|
||||
|
||||
public function test_content_wrapped_in_specific_html_comments()
|
||||
{
|
||||
// These comments are used to identify head content for editor injection
|
||||
$this->setSettings(['app-custom-head' => '<script>console.log("cat");</script>']);
|
||||
$resp = $this->get('/login');
|
||||
$resp->assertSee('<!-- Start: custom user content -->', false);
|
||||
$resp->assertSee('<!-- End: custom user content -->', false);
|
||||
}
|
||||
|
||||
public function test_configured_content_does_not_show_on_settings_page()
|
||||
{
|
||||
$this->setSettings(['app-custom-head' => '<script>console.log("cat");</script>']);
|
||||
|
Reference in New Issue
Block a user