Requested on Discord.
Many IDEs offer a "sort lines" option, and CodeMirror could, too. At minimum we could add a keyboard shortcut, or maybe two – one for ascending, then the other using Shift to sort descending. Additionally we could add a button to WikiEditor in the "Advanced" section, perhaps as part of the "Format" group of buttons.
Sorting should be done using localeCompare with "base" sensitivity, so that accents and capitalization are taken into account. If a particular language or wiki needs further customization, we can offer it either as a gadget or directly in CodeMirror, depending on how widespread the needs are.