PEP8
Escape, urlize and assign the right CSS class for message body parts
Minor crasher