Page MenuHomePhabricator

Presence of <nowiki/> on a page break everything in VisualEditor
Closed, DuplicatePublic

Description

(Originally reported in T187690#4011239, this is the short version)

Edit any page that has a <nowiki/> in it, for example:

foo<nowiki/>bar

All kinds of things break, for example:

  • Ctrl+A throws an exception
  • Deleting across a selection which should contain the <nowiki/> instead deletes text in weird places

Event Timeline

This is a regression from rGVED21a5d55b85dd: [BREAKING CHANGE] Store metadata as block nodes in the main data list.

In VE, the <nowiki/> turns into an alienMeta node, and I guess that has no rendering in CE and that breaks stuff?

Looks like ve.ce.Document.prototype.getNodeAndOffset only handles nodes without a "DOM representation" (same thing as I meant by "no rendering in CE") when they appear elsewhere than inside ve.ce.ContentBranchNode – this was actually added recently in rGVEDc7e904bb49fc: Fix getNodeAndOffset for MetaItems to fix T186109. In this case though the alienMeta is inside a paragraph which is a ContentBranchNode :(