Support start-sorting and end-sorting directive