Remove EOL spaces and resolve p tag mismatch