@@ -692,35 +692,43 @@ public function test_markdown_base64_extract_not_limited_by_pcre_limits()
692
692
693
693
public function test_base64_images_within_markdown_blanked_if_not_supported_extension_for_extract ()
694
694
{
695
- $ this ->asEditor ();
696
695
$ page = Page::query ()->first ();
697
696
698
- $ this ->put ($ page ->getUrl (), [
697
+ $ this ->asEditor ()-> put ($ page ->getUrl (), [
699
698
'name ' => $ page ->name , 'summary ' => '' ,
700
699
'markdown ' => 'test  ' ,
701
700
]);
702
701
703
- $ page ->refresh ();
704
- $ this ->assertStringContainsString ('<img src="" ' , $ page ->html );
702
+ $ this ->assertStringContainsString ('<img src="" ' , $ page ->refresh ()->html );
705
703
}
706
704
707
705
public function test_nested_headers_gets_assigned_an_id ()
708
706
{
709
- $ this ->asEditor ();
710
707
$ page = Page::query ()->first ();
711
708
712
709
$ content = '<table><tbody><tr><td><h5>Simple Test</h5></td></tr></tbody></table> ' ;
713
- $ this ->put ($ page ->getUrl (), [
710
+ $ this ->asEditor ()-> put ($ page ->getUrl (), [
714
711
'name ' => $ page ->name ,
715
712
'html ' => $ content ,
716
- 'summary ' => '' ,
717
713
]);
718
714
719
- $ updatedPage = Page::query ()->where ('id ' , '= ' , $ page ->id )->first ();
720
-
721
715
// The top level <table> node will get assign the bkmrk-simple-test id because the system will
722
716
// take the node value of h5
723
717
// 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 );
725
733
}
726
734
}
0 commit comments