public function doRender($rawContent, array $attributes = [])
    {
        $renderer = $this->renderer;

        if ($renderer === null) {
            $rendered = $rawContent;
        } elseif ($renderer instanceof Renderer) {
            $rendered = $renderer->render($rawContent, $attributes);
        } elseif ($renderer instanceof \Closure) {
            $rendered = call_user_func($renderer, $rawContent, $attributes);
        } else {
            throw new \Exception('Invalid renderer given. Expecting null, instance of Gen\Renderer\Renderer or valid callback.');
        }

        return $this->renderedContent = $rendered;
    }