Board Thread:Support Requests - Getting Technical/@comment-3361105-20160404184555

A long while ago, I created a template called TheSort to be used in category-add links (mostly automatically by the DC wiki's extensive use of page-templates). It was meant to ignore the "The" at the beginning of page names, and ensure that pages sorted alphabetically when viewing categories in list-mode. Fine and good. It works as it's supposed to - except this one case:

I've run into trouble where the pagename contains an ampersand.

For example, Category:Batman & Robin Eternal Vol 1 is listing the items out of order, and I don't know why, because the sorting template outputs in the correct format (which, in the case of say issue #2 would be "Batman & Robin Vol 1 0002A" for reasons that are complicated).

The same applies to any series that contains an ampersand, so I have to assume it's something to do with the use of the ascii 38 code (which produces an ampersand) in the pagenames versus a plain text "&"- except I have no idea why, because the sorting function doesn't even apply to that part of the pagename.

Can somebody offer a work-around, whether it's a simple replace function that needs to be implemented, or something more wonky? 