Fix displaying messages with invalid self-closing HTML tags (#1489137)