When I type LaTeX formula
$$\mathbf{w} = \left(X^T X + \lambda
\begin{bmatrix}
0 & \quad & \quad & \quad & \quad \\
\quad & 1 & \quad & \quad & \quad \\
\quad & \quad & 1 & \quad & \quad \\
\quad & \quad & \quad & \ddots & \quad \\
\quad & \quad & \quad & \quad & 1
\end{bmatrix}
\right)^{-1} X^T \mathbf{y}$$
Its rendering output looks like this:
I think there is something wrong. The “nbsp;” thing should not be there, because I didn’t type anything about that.