\documentclass{article}
\begin{document}
\begin{equation}
x = \frac \lambda b
\end{equation}
\begin{equation}
x = \frac12
\end{equation}
\end{document}
with spaces added and removed at will.
It still gives warnings because it tries to print capture group variables which haven't captured anything. It also does not deal with newlines or comment symbols yet. I am not sure what is the best way to fix either of these issues.
This is not polished yet.
It sanitizes the cases in https://github.com/ftilmann/latexdiff/issues/50 and more, such as
with spaces added and removed at will.
It still gives warnings because it tries to print capture group variables which haven't captured anything. It also does not deal with newlines or comment symbols yet. I am not sure what is the best way to fix either of these issues.