Fix missing text nodes that preceeded comments.
Add whitespace before repeated elements (th:each) to preserve the look
of the result.