Page MenuHomePhabricator

Parsoid: Annotated text after a template is deleted
Closed, ResolvedPublic

Description

When inserting any template immediately before any word that is linked or has bold or italic markup, that word is deleted but continues to be displayed in the editing surface. The deletion can only be seen in review changes or upon saving.

To reproduce:

  1. Open any page in VE.
  2. Place the cursor immediately before a word (i.e. with no white space between the cursor and word) that is one or more of:
    • A link
    • Bold text
    • Italic text
    • plain text that you have just added one of the above to
  3. Insert any template at the cursor position
  4. Observe the word remains as expected
  5. Review changes, and observe the word has been deleted.

Examples: https://en.wikipedia.org/w/index.php?title=User%3AThryduulf%2Fsandbox2&diff=570195482&oldid=570194023

On en.wp PamD encountered this bug when inserting a maintenance template at the head of an article that started with a bold word.


Version: unspecified
Severity: critical

Details

Reference
bz53334

Event Timeline

bzimport raised the priority of this task from to Unbreak Now!.Nov 22 2014, 1:49 AM
bzimport added a project: Parsoid.
bzimport set Reference to bz53334.

This does not require pre-existing formatted or linked text. The bug also appears if you enter the template first and then add bold word(s) immediately afterwards (no space between the template and the text), starting from an empty page or in a new paragraph.

For example, using VisualEditor with the intention of producing this, in this order:

{{unreferenced}}'''Hello world''' from Wikipedia.

actually results in this:

{{unreferenced}} from Wikipedia.

If you add a space or hit return after the template, then it works as expected.

HTML

<p><span typeof="mw:Transclusion" data-mw="{&quot;target&quot;:{&quot;href&quot;:&quot;Template:Inline&quot;,&quot;wt&quot;:&quot;Inline&quot;},&quot;params&quot;:{&quot;1&quot;:{&quot;wt&quot;:&quot;Foo&quot;}}}"></span><b>bar</b>quux</p>

Expected wikitext

{{Inline|Foo}}'''bar'''quux

Actual wikitext

{{Inline|Foo}}quux

:(

  • This bug has been marked as a duplicate of bug 53434 ***

This is the same Parsoid bug that affected both places where we implicitly assumed that the 'about' id is always present (without realizing/checking that it could be absent for VE-inserted transclusions).