Fix infinite loop when converting invalid html to plaintext (#1489566)