@@ -692,35 +692,43 @@ public function test_markdown_base64_extract_not_limited_by_pcre_limits()
692692
693693 public function test_base64_images_within_markdown_blanked_if_not_supported_extension_for_extract ()
694694 {
695- $ this ->asEditor ();
696695 $ page = Page::query ()->first ();
697696
698- $ this ->put ($ page ->getUrl (), [
697+ $ this ->asEditor ()-> put ($ page ->getUrl (), [
699698 'name ' => $ page ->name , 'summary ' => '' ,
700699 'markdown ' => 'test  ' ,
701700 ]);
702701
703- $ page ->refresh ();
704- $ this ->assertStringContainsString ('<img src="" ' , $ page ->html );
702+ $ this ->assertStringContainsString ('<img src="" ' , $ page ->refresh ()->html );
705703 }
706704
707705 public function test_nested_headers_gets_assigned_an_id ()
708706 {
709- $ this ->asEditor ();
710707 $ page = Page::query ()->first ();
711708
712709 $ content = '<table><tbody><tr><td><h5>Simple Test</h5></td></tr></tbody></table> ' ;
713- $ this ->put ($ page ->getUrl (), [
710+ $ this ->asEditor ()-> put ($ page ->getUrl (), [
714711 'name ' => $ page ->name ,
715712 'html ' => $ content ,
716- 'summary ' => '' ,
717713 ]);
718714
719- $ updatedPage = Page::query ()->where ('id ' , '= ' , $ page ->id )->first ();
720-
721715 // The top level <table> node will get assign the bkmrk-simple-test id because the system will
722716 // take the node value of h5
723717 // So the h5 should get the bkmrk-simple-test-1 id
724- $ this ->assertStringContainsString ('<h5 id="bkmrk-simple-test-1">Simple Test</h5> ' , $ updatedPage ->html );
718+ $ this ->assertStringContainsString ('<h5 id="bkmrk-simple-test-1">Simple Test</h5> ' , $ page ->refresh ()->html );
719+ }
720+
721+ public function test_non_breaking_spaces_are_preserved ()
722+ {
723+ /** @var Page $page */
724+ $ page = Page::query ()->first ();
725+
726+ $ content = '<p> </p> ' ;
727+ $ this ->asEditor ()->put ($ page ->getUrl (), [
728+ 'name ' => $ page ->name ,
729+ 'html ' => $ content ,
730+ ]);
731+
732+ $ this ->assertStringContainsString ('<p id="bkmrk-%C2%A0"> </p> ' , $ page ->refresh ()->html );
725733 }
726734}
0 commit comments