Page MenuHomePhabricator

Should VE copy ids?
Open, MediumPublic

Description

In T245206#6208042, when inserting a paragraph, VE is duplicating an id. It seems to be doing this, at least in the list item case T247168#5951215, to preserve the whitespace context, along the lines of T53654 and T195486. However, this runs aground with the dom diffing algorithm, leading to some undesirable results (ie. additional sections of the page being marked as new and normalized).

Here's a paste from the Parsing-Team--ARCHIVED discussion today,

  1. Creating new paragraph by copying an id seems broken. (But there is a legit use for copy-and-paste. Grey area: list items, where "list item format style" ought to be a property of the list, somehow, not requiring copying ids from individual list items.) We could instead fix the list-item issue by fixing T53654: Match whitespace style of other list items when adding a new list item.
  2. Is using 'id' attribute problematic for associating data-mw/data-parsoid, since we might want to copy and DOM library might have edge case bugs since id->node is assumed to be a 1:{0,1} map.
  3. DOM tree diffing is probably both too complex and too simple, aka, we really don't need a full minimal diff we just need to know if there's a substring of wikitext in the original which exactly matches a particular subtree of DOM (and in some places 'subtree' isn't quite the right thing). So this could be a limitation of the current diff.

Event Timeline

ssastry moved this task from Needs Triage to Needs Investigation on the Parsoid board.
JTannerWMF moved this task from To Triage to Triaged on the VisualEditor board.
JTannerWMF added subscribers: ssastry, JTannerWMF.

@ssastry let us know if you need anything from Editing otherwise it is going in External.

@JTannerWMF Yes, please, we need information. What's the goal in copying the ids and when is it done?