Page MenuHomePhabricator

Parsoid: Preserve HTML entities in {{DEFAULTSORT}} values on round-trip
Closed, ResolvedPublic

Description

Right now, I get:

$ echo '{{DEFAULTSORT:foo}}' | node js/tests/parse.js
<body data-parsoid='{"dsr":[0,20,0,0]}'><span data-parsoid='{"tsr":[0,19],"src":"{{DEFAULTSORT:foo}}","dsr":[0,19,null,null]}' about="#mwt1" typeof="mw:Object/Template"></span><meta about="#mwt1" property="mw:TemplateParams" content='[{"id":"mwt1","target":"DEFAULTSORT:Foo","params":{}}]'>
</body>

So {{DEFAULTSORT:foo}} is simply interpreted as a template. For bug 46465, I would like this to be its own RDFa type instead, just like NOTOC


Version: unspecified
Severity: normal

Details

Reference
bz46470

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:41 AM
bzimport set Reference to bz46470.

This can be handled in the template handler (js/lib/ext.core.TemplateHandler.js). The key should be case-insensitive, and should support aliases. This is already partly handled in the TemplateHandler (search for translatedPrefix).

A localized DEFAULTSORT call should also round-trip properly (preserving the original key and value. This will require adding some support for this in the WikitextSerializer.

The expected output is described in http://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Category_default_sort_key.

Sam Bleckley is planning to work on this. He is not yet on bugzilla, so I can't assign to him. Assigning to myself as a stand-in.

Related URL: https://gerrit.wikimedia.org/r/59565 (Gerrit Change I0d4c2b3d087fba700f91c2714cec5b8933882ca0)

Basic support was implemented by Toby Hutton in the patch above. Editing support is still missing, but should not be too hard to add.

https://gerrit.wikimedia.org/r/59565 (Gerrit Change I0d4c2b3d087fba700f91c2714cec5b8933882ca0) | change APPROVED and MERGED [by jenkins-bot]

(In reply to comment #4)

Basic support was implemented by Toby Hutton in the patch above.

Thanks, Toby!

Editing
support is still missing, but should not be too hard to add.

Repurposing this bug to be about editing then.

Related URL: https://gerrit.wikimedia.org/r/65274 (Gerrit Change I827a37603e95b33f5e913097b9f8c0844d540110)

https://gerrit.wikimedia.org/r/65274 (Gerrit Change I827a37603e95b33f5e913097b9f8c0844d540110) | change APPROVED and MERGED [by jenkins-bot]

The above commit should have fixed this in the first iteration. There are still issues around HTML entity round-tripping, so I am repurposing this bug to be about that.

Related URL: https://gerrit.wikimedia.org/r/66043 (Gerrit Change I45bbb5c01b00cffb07ac69e237aca63a32730f17)

https://gerrit.wikimedia.org/r/66043 (Gerrit Change I45bbb5c01b00cffb07ac69e237aca63a32730f17) | change APPROVED and MERGED [by jenkins-bot]