File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -60,13 +60,19 @@ private function mapProsemirrorNodes(array $node): ?array
6060 ]
6161 );
6262
63- $ asset = $ assetContainer ->asset (path: $ transformer ->transform ($ node ['attrs ' ]['src ' ]));
63+ $ path = $ transformer ->transform ($ node ['attrs ' ]['src ' ]);
64+
65+ if (! $ path ) {
66+ return null ;
67+ }
68+
69+ $ asset = $ assetContainer ->asset (path: $ path );
6470
6571 if (! $ asset ) {
6672 return null ;
6773 }
6874
69- $ node ['attrs ' ]['src ' ] = $ asset ->id ();
75+ $ node ['attrs ' ]['src ' ] = ' asset:: ' . $ asset ->id ();
7076 }
7177
7278 if (isset ($ node ['content ' ])) {
Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ public function it_handles_images()
178178 [
179179 'type ' => 'image ' ,
180180 'attrs ' => [
181- 'src ' => 'assets::2024/10/image.png ' ,
181+ 'src ' => 'asset:: assets::2024/10/image.png ' ,
182182 ],
183183 ],
184184 ], $ output );
@@ -221,7 +221,7 @@ public function it_handles_nested_images()
221221 [
222222 'type ' => 'image ' ,
223223 'attrs ' => [
224- 'src ' => 'assets::2024/10/image.png ' ,
224+ 'src ' => 'asset:: assets::2024/10/image.png ' ,
225225 ],
226226 ],
227227 ],
@@ -305,7 +305,7 @@ public function it_downloads_images()
305305 [
306306 'type ' => 'image ' ,
307307 'attrs ' => [
308- 'src ' => 'assets::2024/10/image.png ' ,
308+ 'src ' => 'asset:: assets::2024/10/image.png ' ,
309309 ],
310310 ],
311311 ], $ output );
@@ -353,7 +353,7 @@ public function it_downloads_images_and_stores_them_in_configured_folder()
353353 [
354354 'type ' => 'image ' ,
355355 'attrs ' => [
356- 'src ' => 'assets::custom-folder/image.png ' ,
356+ 'src ' => 'asset:: assets::custom-folder/image.png ' ,
357357 ],
358358 ],
359359 ], $ output );
You can’t perform that action at this time.
0 commit comments