You are here

public function BlockParser::freeform in Gutenberg 8.2

Returns a new block object for freeform HTML.

@internal @since 3.9.0

Parameters

string $innerHTML: HTML content of block.

Return value

BlockParserBlock Freeform block object.

3 calls to BlockParser::freeform()
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 343

Class

BlockParser
Class BlockParser.

Namespace

Drupal\gutenberg\Parser

Code

public function freeform($innerHTML) {
  return new BlockParserBlock(NULL, $this->emptyAttrs, [], $innerHTML, [
    $innerHTML,
  ]);
}