The default renderers in Contentful\RichText\NodeRenderer\* are not forwarding the context to the render() and renderCollection() calls. For instance, Contentful\RichText\NodeRenderer\Document (which I do not add a version of myself):
/**
* {@inheritdoc}
*/
public function render(RendererInterface $renderer, NodeInterface $node, array $context = []): string
{
/* @var NodeClass $node */
if (!$node instanceof NodeClass) {
throw new \LogicException(\sprintf('Trying to use node renderer "%s" to render unsupported node of class "%s".', \get_class($this), \get_class($node)));
}
return $renderer->renderCollection($node->getContent()); // <-- CONTEXT SHOULD BE SECOND PARAMETER
}
Hey!
The default renderers in
Contentful\RichText\NodeRenderer\*
are not forwarding the context to the render() and renderCollection() calls. For instance,Contentful\RichText\NodeRenderer\Document
(which I do not add a version of myself):If I get chance I'll PR this in.