Feeding
\documentclass{article}
\pagestyle{empty}
\usepackage{todonotes}
\begin{document}%
\listoftodos
\todo{\(\ifmmode MATH \else TEXT\fi\)}%%% $…$ instead of \(…\) fails as well.
\end{document}
to pdflatex yields
However, the expected outcome is printed in the Todo list, and not .
Why does this happen, who is the culprit, and what to do?
The same issue: https://github.com/henrikmidtiby/todonotes/issues/63 .

