VisualEditor: Share ref / references re-rendering code with Parsoid
Open, NormalPublic

Description

We have a relatively complete DOM-based references rendering implementation in Parsoid that could be reused by VisualEditor. This would avoid us implementing two versions of essentially the same code, and with combined effort should result in a better implementation.


See Also:
T52474: In VisualEditor, references in templates cannot be reused and are numbered separately from references in the text.

Details

Reference
bz50505
bzimport raised the priority of this task from to High.
bzimport set Reference to bz50505.
GWicke created this task.Jul 1 2013, 5:16 PM
GWicke added a comment.Jul 1 2013, 5:18 PM

Sorry, somehow managed to hit return.

We have a relatively complete DOM-based references rendering implementation in Parsoid that could be reused by VisualEditor. This would avoid us implementing two versions of essentially the same code, and with combined effort should result in a better implementation.

GWicke added a comment.Jul 1 2013, 5:21 PM

Possibly also relevant for bug 50474, in case that turns out to be hard to fix in your current implementation.

Parsoid gives us a DOM with references already numbered, so we probably want to use their numbering and reference list as a base, then update that as required.

GWicke added a comment.Jul 1 2013, 8:44 PM

I would not recommend to hack something around the numbering we give you. We should rather share the ref / references rendering code so that you can simply call that code to fully renumber refs and re-render the references blocks.

Indeed, basically the logic we currently have (or call from) ve.ce.MWReferenceListNode and ve.ce.MWReferenceNode. Converting data-mw into a the dom as it should be given to the browser (html tag name, class name, children composition and attributes etc.). And for ref nodes the sequence between different ones as well. Though VE may have to run the logic more often (where parsoid presumably only runs it once per document) it'd be nice to share this logic.

The HTML rendered by MediaWiki extension tags and/or parser functions should not be hardcoded in VE. Perhaps in a VE plugin, but since it'd be the same for Parsoid as for VE, it'd be nice if this can be shared so that a MediaWiki extension that wants to have logic for Parsoid/VE only needs 1 type of plugin that both can use.

Jdforrester-WMF lowered the priority of this task from High to Normal.Jan 9 2015, 10:55 PM
Liuxinyu970226 added a subscriber: Aklapper.
Krinkle updated the task description. (Show Details)Mar 16 2017, 6:12 PM
Krinkle removed a subscriber: Krinkle.