def visit_reference(self, node: Element) -> None:
    if isinstance(node.parent, (nodes.title, addnodes.desc_type)):
        return
    if isinstance(node[0], nodes.image):
        return
    name = node.get('name', node.astext()).strip()
    uri = node.get('refuri', '')
    if ((not uri) and node.get('refid')):
        uri = ((('%' + self.curfilestack[(- 1)]) + '#') + node['refid'])
    if (not uri):
        return
    if uri.startswith('mailto:'):
        uri = self.escape_arg(uri[7:])
        name = self.escape_arg(name)
        if ((not name) or (name == uri)):
            self.body.append(('@email{%s}' % uri))
        else:
            self.body.append(('@email{%s,%s}' % (uri, name)))
    elif uri.startswith('#'):
        id = ((self.curfilestack[(- 1)] + ':') + uri[1:])
        self.add_xref(id, name, node)
    elif uri.startswith('%'):
        hashindex = uri.find('#')
        if (hashindex == (- 1)):
            id = (uri[1:] + '::doc')
        else:
            id = uri[1:].replace('#', ':')
        self.add_xref(id, name, node)
    elif uri.startswith('info:'):
        uri = uri[5:].replace('_', ' ')
        uri = self.escape_arg(uri)
        id = 'Top'
        if ('#' in uri):
            (uri, id) = uri.split('#', 1)
        id = self.escape_id(id)
        name = self.escape_menu(name)
        if (name == id):
            self.body.append(('@ref{%s,,,%s}' % (id, uri)))
        else:
            self.body.append(('@ref{%s,,%s,%s}' % (id, name, uri)))
    else:
        uri = self.escape_arg(uri)
        name = self.escape_arg(name)
        show_urls = self.config.texinfo_show_urls
        if self.in_footnote:
            show_urls = 'inline'
        if ((not name) or (uri == name)):
            self.body.append(('@indicateurl{%s}' % uri))
        elif (show_urls == 'inline'):
            self.body.append(('@uref{%s,%s}' % (uri, name)))
        elif (show_urls == 'no'):
            self.body.append(('@uref{%s,,%s}' % (uri, name)))
        else:
            self.body.append(('%s@footnote{%s}' % (name, uri)))
    raise nodes.SkipNode
def visit_reference(self, node: Element) -> None:
    if isinstance(node.parent, (nodes.title, addnodes.desc_type)):
        return
    if isinstance(node[0], nodes.image):
        return
    name = node.get('name', node.astext()).strip()
    uri = node.get('refuri', )
    if ((not uri) and node.get('refid')):
        uri = ((('%' + self.curfilestack[(- 1)]) + '#') + node['refid'])
    if (not uri):
        return
    if uri.startswith('mailto:'):
        uri = self.escape_arg(uri[7:])
        name = self.escape_arg(name)
        if ((not name) or (name == uri)):
            self.body.append(('@email{%s}' % uri))
        else:
            self.body.append(('@email{%s,%s}' % (uri, name)))
    elif uri.startswith('#'):
        id = ((self.curfilestack[(- 1)] + ':') + uri[1:])
        self.add_xref(id, name, node)
    elif uri.startswith('%'):
        hashindex = uri.find('#')
        if (hashindex == (- 1)):
            id = (uri[1:] + '::doc')
        else:
            id = uri[1:].replace('#', ':')
        self.add_xref(id, name, node)
    elif uri.startswith('info:'):
        uri = uri[5:].replace('_', ' ')
        uri = self.escape_arg(uri)
        id = 'Top'
        if ('#' in uri):
            (uri, id) = uri.split('#', 1)
        id = self.escape_id(id)
        name = self.escape_menu(name)
        if (name == id):
            self.body.append(('@ref{%s,,,%s}' % (id, uri)))
        else:
            self.body.append(('@ref{%s,,%s,%s}' % (id, name, uri)))
    else:
        uri = self.escape_arg(uri)
        name = self.escape_arg(name)
        show_urls = self.config.texinfo_show_urls
        if self.in_footnote:
            show_urls = 'inline'
        if ((not name) or (uri == name)):
            self.body.append(('@indicateurl{%s}' % uri))
        elif (show_urls == 'inline'):
            self.body.append(('@uref{%s,%s}' % (uri, name)))
        elif (show_urls == 'no'):
            self.body.append(('@uref{%s,,%s}' % (uri, name)))
        else:
            self.body.append(('%s@footnote{%s}' % (name, uri)))
    raise nodes.SkipNode