Skip to content

Commit

Permalink
Add list block render support
Browse files Browse the repository at this point in the history
  • Loading branch information
alaminfirdows committed Sep 21, 2021
1 parent 7b11c97 commit fb09ddf
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
15 changes: 15 additions & 0 deletions config/laravel_editorjs.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@
],
'level' => [1, 2, 3, 4, 5, 6],
],
'list' => [
'style' => [
0 => 'ordered',
1 => 'unordered',
],
'items' => [
'type' => 'array',
'data' => [
'-' => [
'type' => 'string',
'allowedTags' => 'i,b,a[href],code[class],mark[class]',
],
],
],
],
],
],
];
12 changes: 12 additions & 0 deletions resources/views/blocks/list.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@php
$tag = 'ul';
if('ordered' === $data['style']){
$tag = 'ol';
}
@endphp

<{{ $tag }}>
@foreach($data['items'] as $item)
<li>{{ $item }}</li>
@endforeach
</{{ $tag }}>

0 comments on commit fb09ddf

Please sign in to comment.