Sanitizing similar to how legacy fixes rogue newlines and so on, but perhaps a more structured approach. (Decisions on this?)