Page MenuHomePhabricator

Parsoid: Default whitespace for categories to be a single newline seperator between, and two beforehand
Closed, ResolvedPublic

Description

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.)


Version: unspecified
Severity: trivial
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=49635

Details

Reference
bz48557

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:42 AM
bzimport set Reference to bz48557.

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)