In a comment of the form $\DeclareMathOperator\a{a}$Here's a [link](http://mathoverflow.net) and [another link](http://mathoverflow.net) $\a$
, neither link is parsed; in a comment of the form $\DeclareMathOperator\a{a}$Here's a [link](http://mathoverflow.net)$\DeclareMathOperator\a{a}$ $\a$ and [another link](http://mathoverflow.net)
, the second link is parsed and the first is not; and in a comment of the form Here's a [link](http://mathoverflow.net)$\DeclareMathOperator\a{a}$ and [another link](http://mathoverflow.net) $\a$
, both links are parsed.
1 Answer
This answer is intended for testing.
Please include the source code used in the comments into the answer — so that we can check when the link works and when it doesn't.
 1
$\DeclareMathOperator{\Hom}{Hom}$ [link](http://mathoverflow.net) $\Hom (U\times V,W)$ and [another link](http://mathoverflow.net).
 2
$\DeclareMathOperator{\Hom}{Hom}$ [link](http://mathoverflow.net) $\Hom$ and [another link](http://mathoverflow.net).
 3
$\DeclareMathOperator{\R}{\mathbb R}$[link](http://mathoverflow.net) $\R$ and [another link](http://mathoverflow.net).
 4
$\DeclareMathOperator{\R}{\mathbb R}$ [link](http://mathoverflow.net) $\R$ and [another link](http://mathoverflow.net).
— The difference between this comment and the one before is just the space added before the first link.  5
A $\DeclareMathOperator\a{a}$[link](http://mathoverflow.net) $\a$ and [another link](http://mathoverflow.net).
 6
A [link](http://mathoverflow.net) $\DeclareMathOperator\a{a}$and [another link](http://mathoverflow.net) $\a$.
The problem seems to concern parsing of links between a\DeclareMathOperator
with no following space and the invocation of that math operator, wherever they occur in the comment.  7
$\DeclareMathOperator\a{a}$A [link](http://mathoverflow.net) and [another link](http://mathoverflow.net) $\a$.
 8
$\newcommand{\R}{\mathbb R}$[link](http://mathoverflow.net) $\R$ and [another link](http://mathoverflow.net)  this one uses "newcommand" rather than DeclareMathOperator
 9
$\def\R{\mathbb R}$[link](http://mathoverflow.net) $\R$ and [another link](http://mathoverflow.net)  this one uses "def" rather than DeclareMathOperator
 10
$\let\vp\varphi$[link](http://mathoverflow.net) $\vp$ and [another link](http://mathoverflow.net)  this one uses "let" rather than DeclareMathOperator

$\begingroup$ $\DeclareMathOperator{\Hom}{Hom}$ link $\Hom (U\times V,W)$ and another link. $\endgroup$ Dec 18, 2020 at 16:35

$\begingroup$ $\DeclareMathOperator{\Hom}{Hom}$ link $\Hom$ and another link. $\endgroup$ Dec 18, 2020 at 16:36

$\begingroup$ $\DeclareMathOperator{\R}{\mathbb R}$[link](mathoverflow.net) $\R$ and another link. $\endgroup$ Dec 18, 2020 at 16:37

$\begingroup$ $\DeclareMathOperator{\R}{\mathbb R}$ link $\R$ and another link. $\endgroup$ Dec 18, 2020 at 16:38

$\begingroup$ A $\DeclareMathOperator\a{a}$[link](mathoverflow.net) $\a$ and another link. $\endgroup$– LSpiceDec 18, 2020 at 16:58

$\begingroup$ A link $\DeclareMathOperator\a{a}$and [another link](mathoverflow.net) $\a$. $\endgroup$– LSpiceDec 18, 2020 at 16:59

$\begingroup$ $\DeclareMathOperator\a{a}$A [link](mathoverflow.net) and [another link](mathoverflow.net) $\a$. $\endgroup$– LSpiceDec 18, 2020 at 17:00

1$\begingroup$ $\newcommand{\R}{\mathbb R}$[link](mathoverflow.net) $\R$ and another link  this one uses "newcommand" rather than DeclareMathOperator $\endgroup$ Dec 19, 2020 at 8:29

1$\begingroup$ $\def\R{\mathbb R}$[link](mathoverflow.net) $\R$ and another link  this one uses "def" rather than DeclareMathOperator $\endgroup$ Dec 19, 2020 at 8:29

1$\begingroup$ $\let\vp\varphi$[link](mathoverflow.net) $\vp$ and another link  this one uses "let" rather than DeclareMathOperator $\endgroup$ Dec 19, 2020 at 8:34
\DeclareMathOperator
is at the beginning, and only when\a
is actually used, and that the affected span is between the declaration and the use. I updated the sample text accordingly. $\endgroup$$\DeclareMathOperator\a{a}$Here's a [link](http://mathoverflow.net) $\a$ and [another link](http://mathoverflow.net).
$\endgroup$