Page MenuHomePhabricator

Redirects to categories don't round-trip properly
Closed, ResolvedPublic


echo '#redirect [[Category:Foo]]' | node parse --wt2wt | node parse --wt2wt
#redirect [[Category:Foo]][[Category:Foo]][[Category:Foo]]

It seems that the necessary special-case handing in the serializer is missing. If we assume that editors never insert categories in the middle of the DOM (currently true) then it should be safe to check for the previousSibling of the category link, and avoid serializing it if that is a redirect with the same target.

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:44 AM
bzimport added a project: Parsoid.
bzimport set Reference to bz49503.

Wasn't this a conscious design choice?

Splitting #redirect [[Category:Foo]] into #redirect [[:Category:Foo]][[Category:Foo]] was (so that the VE can edit it). This *will* probably round-trip with selective serialization and is currently not an issue in production as the VE is not supporting editing of redirects at all.

Related URL: (Gerrit Change Id1a79fe8366a9386191b919c2ce446fbf56d4863) (Gerrit Change Id1a79fe8366a9386191b919c2ce446fbf56d4863) | change APPROVED and MERGED [by jenkins-bot]