Remove trailing whitespace / Close unclosed html tags