Page MenuHomePhabricator

VisualEditor: Share ref / references re-rendering code with Parsoid
Closed, InvalidPublic

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

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:56 AM
bzimport added a project: Technical-Debt.
bzimport set Reference to bz50505.

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.

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.

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 Medium.Jan 9 2015, 10:55 PM

Is this exact task still going to happen given PHP Parsoid? (One system being Javascript and the other PHP now.)

Is this exact task still going to happen given PHP Parsoid? (One system being Javascript and the other PHP now.)

Sadly, no.