- From: T29745: References in column affect sorting (if no data-sort-type="number" attribute added to heading of column)
- Patch: e1c56be8708dd7 / https://gerrit.wikimedia.org/r/428146
This patch incurs technical debt by hardcoding logic for the Cite extension in MediaWiki core. We should consider finding a way to trigger the same behaviour without hardcoding this logic.
The outcome should be that:
- The Cite extension is in control of the behaviour.
- The tablesorter extension exposes a documented and tested public interface that is used by Cite extension.
Two options come to mind, but there may be other approaches as well:
- Use exiting tablesorter API: The Cite extension is developed for MediaWki so it is fine for it to contain optional enhancements in its HTML aimed at tablesorter. For example, it could output data-sort-value="" on its <span class="reference"> elements. This would achieve the above outcomes. And:
- Benefit: Does not introduce additional APIs to document, maintain and test for.
- Drawback: May be difficult to implement given this is part of Parser output, which we prefer not to change too often.
- Create an extendable interface for special behaviours. This would mean tablesorter gets a public interface to register class names to ignore, and the Cite extension, either by PHP or JS hook, would adds its "reference" class to that list.
- Neutral: Adds a new feature to support, although it would essentially cost the same in terms of complexity and maintenance as the current patch (except in a more generalised form).
- Benefit: Doesn't involve changing Parser output.