VisualEditor: Transclusion nodes should re-evaluate their block/inline status on every update
OpenPublic

Description

Especially important for newly inserted ones, as at the moment we have no idea what they are going to be so we just assume inline.


Version: unspecified
Severity: enhancement

bzimport added a project: Technical-Debt.Via ConduitNov 22 2014, 2:04 AM
bzimport set Reference to bz49784.
Esanders created this task.Via LegacyJun 18 2013, 10:48 PM
Esanders added a comment.Via ConduitJun 18 2013, 10:50 PM

Possible solution may involve removing distinction between block & inline transclusion types in the DM, replacing with hybrid type, and have CE work out how to render it properly.

Ironholds added a comment.Via ConduitJul 29 2013, 5:14 PM

*** Bug 50363 has been marked as a duplicate of this bug. ***

Jdforrester-WMF added a comment.Via ConduitOct 2 2013, 8:38 PM
  • Bug 54893 has been marked as a duplicate of this bug. ***
Jdforrester-WMF added a comment.Via ConduitNov 25 2013, 10:34 AM
  • Bug 50610 has been marked as a duplicate of this bug. ***
Krinkle added a comment.Via ConduitDec 2 2013, 10:19 PM

Parsoid says they now have a public wt2html API that we can use instead of action=parse. That would at least allow use to let Parsoid determine whether it is inline or block (instead of sniffing the html result, though that's fairly trivial, just <span> vs. everything else, right? Maybe a few other inline elements nodes that we use, or do we wrap them all?)

However we still need to then find a way to swap the data model node instance in that case. Having 1 datamodel type would be nice indeed. We could make it similar to extension tags in that templates have their own class, but it wouldn't be specific to an element type, we can still swap it dynamically (just like we can change lists from UL to OL).

Krinkle added a comment.Via ConduitDec 2 2013, 10:21 PM

(In reply to comment #5)

Parsoid says they now have a public wt2html API that we can use instead of
action=parse. That would at least allow use to let Parsoid determine whether
it
is inline or block (instead of sniffing the html result, though that's fairly
trivial, just <span> vs. everything else, right? Maybe a few other inline
elements nodes that we use, or do we wrap them all?)

However we still need to then find a way to swap the data model node instance
in that case. (..)

From ve.dm.MWTransclusionBlockNode to ve.dm.MWTransclusionInlineNode or visa versa.

Jdforrester-WMF added a comment.Via ConduitMar 20 2014, 11:14 PM
  • Bug 52032 has been marked as a duplicate of this bug. ***
Catrope added a comment.Via ConduitOct 1 2014, 10:35 PM

Inez talked to me about this long-standing problem today. He worked on a solution that involves waiting for the preview to come back before inserting the template, displaying a spinner in the meantime. His code is at https://github.com/Wikia/app/pull/4932/files . It looks a bit rough and it only deals with insertion, but I think the general approach could work out pretty well. If nothing else, it could be a stop-gap until we have collaborative editing and having a transclusion reevaluate its type asynchronously would not be a big deal.

Jdforrester-WMF added a comment.Via ConduitOct 14 2014, 6:41 PM
  • Bug 72045 has been marked as a duplicate of this bug. ***
Jdforrester-WMF moved this task to Backlog on the VisualEditor workboard.Via WebNov 24 2014, 6:42 PM
Ironholds removed a subscriber: Ironholds.Via WebDec 5 2014, 7:44 PM
Jdforrester-WMF lowered the priority of this task from "High" to "Normal".Via WebJan 9 2015, 10:55 PM

Add Comment