I order not to loose the reader of a big document with a lot of new notations, I make each of the notations I introduce an hyperlink to the place it is defined, so at any time, the reader can refer to the definition (in particular when notations are overloaded).
One of the notation I use is a labeled arrow using \xrightarrow from amsmath [1], and I'd like the arrow to be an hyperlink to its definition, but not the label (for external reasons, mainly the label itself should sometimes be a reference to elsewhere).
Of course, embedding the whole \xrightarrow in a \hyperlink{...} also makes the label a link, which I do not want (see the example below, I use colorlinks=true to emphasize which part is a link and which is not).
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{hyperref}
\hypersetup{
colorlinks=true
}
\newtheorem{definition}{Definition}
\begin{document}
\begin{definition}[\hypertarget{Arrow}{Arrow}]
Here I define (A\xrightarrow{\text{\rm long label}} B).
\end{definition}
[A \hyperlink{Arrow}{\xrightarrow{\textrm{long label}}} B]
\end{document}
Looking at other questions about \xrightarrow (e.g. here), it seems to be doable by (worst case) redefining the command, but I'm not comfortable enough with amsmath to do it. Also, I checked the hyperref manual for a command to exclude some text from a label (to do something like hyperlink{Arrow}{\xrightarrow{\exclude{\text{long label}}}}, but I couldn't find such command.
Remarks: The question is about unlinking the label, not just removing the color (which was added in the MWE to clarify the problem, but won't be turned on in the end).
[1] The context is that I define the transitions of a labeled transition system (for computer scientists).


\textrmhere not\textso you get a consistent font not italic in the definition. – David Carlisle Aug 11 '20 at 09:52