Page MenuHomePhabricator

PoC: Provide a visual editor input field to write subref content, serialize it into the "details" attribute
Open, Needs TriagePublic

Description

As part of the "details" syntax for subreferencing, we would want visual edits to be serialized into a wikitext-containing attribute.

The goal is to create a proof-of-concept, demonstrating how this will be implemented for the details approach.

Acceptance criteria:

  • Parsoid should deliver the content of the attribute and there's a conversion from plain text in Wikitext
  • VE is able to display the content in an editable surface
  • VE applied edits can be saved and are converted back to the attribute in Wikitext

Out of scope

  • Rendering in VE and the Parser - ideally we can connect it to existing sub-ref code though
  • Directly wiring a live editing surface on the document into the attribute editor. Instead we will emulate it by editing a detached or hidden surface and then serializing that into the attribute. See the Wikitext 2017 editor for a precedent.

Event Timeline

We discussed this with @dchan and our current agreement is that we don't have to implement this mechanism yet. It would be acceptable to have the visual editing surface wired to a detached node, and then explicitly serialize the result back to wikitext which we store in an attribute.

Solving the issue will be important for long-term maintainability, but doesn't block our feature.

WMDE-Fisch renamed this task from Investigation: wiring visual editing surface to an attribute to PoC: Wiring visual editing surface to an attribute.Wed, Nov 13, 1:53 PM
WMDE-Fisch updated the task description. (Show Details)

The 2017 wikitext editor essentially works like this when you open a dialog. A hidden visual-mode surface is passed to the window manager, and any insertion by the dialog is done into that surface. When the dialog closes the contents are serialized then converted to wikitext before inserted into the source-mode document. The code for this lives in ve.ui.WindowAction.js.

awight renamed this task from PoC: Wiring visual editing surface to an attribute to PoC: Wiring visual editing surface to an attribute, through a one-off serialization.Mon, Nov 18, 1:24 PM
awight renamed this task from PoC: Wiring visual editing surface to an attribute, through a one-off serialization to PoC: Provide a visual editor input field to write subref content, serialize it into the "details" attribute.
awight updated the task description. (Show Details)