private function resolveElement(DescriptorAbstract $element, $link, ?string $description = null): string
    {
        $rule = $this->router->match($element);

        if ($rule) {
            $url = '..' . $rule->generate($element);
            $link = $this->generateMarkdownLink($url, $description ?: (string) $link);
        }

        return $link;
    }