EditorJS/EditorJS.php
public function getBlocks()
    {
        $sanitizedBlocks = [];

        foreach ($this->blocks as $block) {
            $sanitizedBlock = $this->handler->sanitizeBlock($block['type'], $block['data']);
            if (!empty($sanitizedBlock)) {
                array_push($sanitizedBlocks, $sanitizedBlock);
            }
        }

        return $sanitizedBlocks;
    }
public function getBlocks()
    {
        $sanitizedBlocks = [];

        foreach ($this->blocks as $block) {
            $sanitizedBlock = $this->handler->sanitizeBlock($block['type'], $block['data']);
            if (!empty($sanitizedBlock)) {
                array_push($sanitizedBlocks, $sanitizedBlock);
            }
        }

        return $sanitizedBlocks;
    }
public function getBlocks ( ) { $ sanitizedBlocks = [ ] ; foreach ( $ this -> blocks as $ block ) { $ sanitizedBlock = $ this -> handler -> sanitizeBlock ( $ block [ 'type' ] , $ block [ 'data' ] ) ; if ( ! empty ( $ sanitizedBlock ) ) { array_push ( $ sanitizedBlocks , $ sanitizedBlock ) ; } } return $ sanitizedBlocks ; }
Sanitize and return array of blocks according to the Handler's rules.

@return array
Sanitize and return array of blocks according to the Handler s rules .