Steps to reproduce:
- Find an article with several categories.
- Open it for editing in NWE.
- Change something.
- Preview.
Expected:
The categories should be shown in source order.
Actual:
The categories are shown in alphabetical order.
Steps to reproduce:
Expected:
The categories should be shown in source order.
Actual:
The categories are shown in alphabetical order.
I don't think so. Parsoid preserves source order.
[subbu@earth:~/work/wmf/parsoid] echo "a [[Category:Foo]] [[Category:Bar]]" | parse.js --normalize=parsoid <p>a</p> <link rel="mw:PageProp/Category" href="./Category:Foo"/> <link rel="mw:PageProp/Category" href="./Category:Bar"/>
See the output order when fed HTML.
[subbu@earth:~/work/wmf/parsoid] echo "a [[Category:Foo]] [[Category:Bar]]" | parse.js --normalize=parsoid | parse.js --html2wt a [[Category:Foo]] [[Category:Bar]]
Indeed, ve.init.mw.ArticleTarget.prototype.renderCategories does the sorting, and actually seems to do so on purpose, though I don't really understand why (since the hidden cat flag is determined async, the categories might be in random order after the promises are all done, but sorting according to either the sortkey or the category name just doesn't make sense).
Change 444599 had a related patch set uploaded (by DLynch; owner: DLynch):
[mediawiki/extensions/VisualEditor@master] init.mw.ArticleTarget: sort categories correctly in renderCategories
Change 444599 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] init.mw.ArticleTarget: sort categories correctly in renderCategories
Change 444920 had a related patch set uploaded (by DLynch; owner: DLynch):
[mediawiki/extensions/VisualEditor@master] init.mw.ArticleTarget: make sure renderCategories preserves order
Change 444920 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] init.mw.ArticleTarget: make sure renderCategories preserves order