Sort out markup