Ordering markup to match the content order