diff --git a/app/Services/ExportService.php b/app/Services/ExportService.php index d912671b0..abc473262 100644 --- a/app/Services/ExportService.php +++ b/app/Services/ExportService.php @@ -8,7 +8,7 @@ use BookStack\Repos\EntityRepo; class ExportService { - const VIDEO_REGEX = "/\\<\/video>/"; + const VIDEO_REGEX = "/\\<\/video>/"; const YOUTUBE_REGEX = "/\<\/iframe>/"; const VIMEO_REGEX = "/\<\/iframe>/"; const GOOGLE_MAP_REGEX = "/\<\/iframe>/"; diff --git a/tests/Entity/ExportTest.php b/tests/Entity/ExportTest.php index 7fa485f20..5f60c6671 100644 --- a/tests/Entity/ExportTest.php +++ b/tests/Entity/ExportTest.php @@ -112,4 +112,27 @@ class ExportTest extends TestCase $resp->assertHeader('Content-Disposition', 'attachment; filename="' . $chapter->slug . '.html'); } + public function test_html_export_media_protocol_updated() + { + $page = Page::first(); + $page->html = '

 

 

'; + $page->save(); + + $this->asEditor(); + $resp = $this->get($page->getUrl('/export/html')); + $resp->assertStatus(200); + + $checks = [ + 'https://www.youtube.com/embed/LkFt_fp7FmE', + 'https://player.vimeo.com/video/276396369?title=0&amp;byline=0', + 'https://maps.google.com/embed?testquery=true', + 'https://www.dailymotion.com/embed/video/x2rqgfm', + ]; + + foreach ($checks as $check) { + $resp->assertSee($check); + } + + } + } \ No newline at end of file