Thread:Extension talk:CategorySortHeaders/Tested/reply (9)

The \n just makes the pagename be considered if and only if there is a tie (The idea being that people specify the entire sortkey in the, and the pagename is only ever used if there is a tie). If you have three pages like P1, PTWO, P3 that all have the exact same on them, they'd be sorted in the order P1, P3, PTWO because 3 comes before T alphabetically. Even without the '\n' in the sortkey, this would still be the same.

To see the difference that the \n makes, consider if you have two pages:
 * John, and it has on it
 * Fred, and it has on it

(Suppose for example the pages represent the people John Smith and Fred Smit. We'd want the order them by last name, so we should have John first, and Fred second (Smit comes before Smith in the phonebook). With the \n this is the case. Without it, the order would be Fred first, and John second (because SmithFred is alphabetically before SmitJohn since h comes before j).