config = $config; } public function render(AbstractBlock $block, ElementRendererInterface $htmlRenderer, $inTightList = false) { if (!($block instanceof TableOfContents)) { throw new \InvalidArgumentException('Incompatible block type: ' . get_class($block)); } $content = $htmlRenderer->renderBlocks($block->children()); return $this->config->templateRenderer ->getEngine($this->config) ->render('theme::partials/table_of_contents', ['content' => $content]); } }