File tree Expand file tree Collapse file tree
resources/js/components/fieldtypes/bard Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -448,7 +448,7 @@ export default {
448448 const content = this .valueToContent (value);
449449
450450 if (JSON .stringify (content) !== JSON .stringify (oldContent)) {
451- this .editor .commands .clearContent ();
451+ this .editor .commands .clearContent (false );
452452 this .editor .commands .setContent (content, true );
453453 }
454454 },
Original file line number Diff line number Diff line change @@ -631,6 +631,36 @@ public function it_removes_empty_nodes()
631631 ]);
632632 }
633633
634+ #[Test]
635+ public function it_does_not_remove_sets_when_trimming_empty_nodes ()
636+ {
637+ $ content = [
638+ ['type ' => 'paragraph ' ],
639+ [
640+ 'type ' => 'set ' ,
641+ 'attrs ' => [
642+ 'id ' => 'test-set ' ,
643+ 'values ' => [
644+ 'type ' => 'one ' ,
645+ ],
646+ ],
647+ ],
648+ ['type ' => 'paragraph ' ],
649+ ];
650+
651+ $ this ->assertEquals ([
652+ [
653+ 'type ' => 'set ' ,
654+ 'attrs ' => [
655+ 'id ' => 'test-set ' ,
656+ 'values ' => [
657+ 'type ' => 'one ' ,
658+ ],
659+ ],
660+ ],
661+ ], $ this ->bard (['remove_empty_nodes ' => 'trim ' ])->process ($ content ));
662+ }
663+
634664 #[Test]
635665 #[DataProvider('groupedSetsProvider ' )]
636666 public function it_preloads ($ areSetsGrouped )
You can’t perform that action at this time.
0 commit comments