Edit content to make valid markup