public function render()
    {
        $result = $this->spec->check($this->attributes);
        if ($result->failed()) {
            throw new InvalidAttributesException($result);
        }

        $attributes = $this->renderAttributes();
        if (strlen($attributes)) {
            $attributes = ' ' . $attributes;
        }

        if ($this->selfClosing) {
            return vsprintf(
                '<%s%s/>',
                [$this->tagName, $attributes]
            );
        }

        return vsprintf(
            '<%s%s>%s</%s>',
            [
                $this->tagName,
                $attributes,
                $this->renderContent(),
                $this->tagName,
            ]
        );
    }