Last modified: 2013-06-17 15:25:46 UTC
Hope this is clear - currently: <p>Text</p><link rel="mw:WikiLink/Category" href="./Category:Foo"><link rel="mw:WikiLink/Category" href="./Category:Bar"><link rel="mw:WikiLink/Category" href="./Category:Baz"> serialises to: Text[[Category:Foo]][[Category:Bar]][[Category:Baz]] and ideally we'd like: Text [[Category:Foo]] [[Category:Bar]] [[Category:Baz]] Is this do-able? (If the two-new-lines bit is hard, happy to postpone that side.)
Categories are already serialized on their own line (see bug 48332). The extra newline is possible if you only add categories at the end of a document.
OK, I'm a fool, you'd already done most of the request in bug 48332, sorry. Re-purposing. Gabriel says that this needs us to add new categories to the end of the DOM; I think we do. Will check first.
It looks like whitespace around categories is working properly now. The only remaining issue is whitespace around {{DEFAULTSORT}}, which needs the same rules as categories.
https://gerrit.wikimedia.org/r/67890 also helps in preserving whitespace around existing categories and defaultsorts when we edit them.
Related URL: https://gerrit.wikimedia.org/r/69026 (Gerrit Change Ib37ccaca5ff83950742ced8f4ec3af13e81fbfab)
Fixed in the merged commit.