getSubParser()->parseLocal($node->getValue()); } else { // If the $node is null, it represents a node with no content. // Some directives - like "figure" - both allow content AND no content. $document = $node; } $newNode = $this->processSub($parser, $document, $variable, $data, $options); if ($newNode === null) { return; } if ($variable !== '') { $parser->getEnvironment()->setVariable($variable, $newNode); } else { $parser->getDocument()->addNode($newNode); } } /** @param string[] $options */ public function processSub( Parser $parser, ?Node $document, string $variable, string $data, array $options ): ?Node { return null; } }