You are here

protected function BlockParser::addToOutput in Gutenberg 8.2

Add a block to the list of outputs.

Parameters

array $block: The block to output.

3 calls to BlockParser::addToOutput()
BlockParser::addBlockFromStack in src/Parser/BlockParser.php
Pushes the top block from the parsing stack to the output list.
BlockParser::addFreeform in src/Parser/BlockParser.php
Pushes a length of text from the input document to the output list.
BlockParser::proceed in src/Parser/BlockParser.php
Processes the next token from the input document.

File

src/Parser/BlockParser.php, line 440

Class

BlockParser
Class BlockParser.

Namespace

Drupal\gutenberg\Parser

Code

protected function addToOutput(array $block) {
  if (isset($this->filterCallable) && is_callable($this->filterCallable)) {
    if (!call_user_func($this->filterCallable, $block)) {

      // Not interested in the block.
      return;
    }
  }
  $this->output[] = $block;
}