Page MenuHomePhabricator

Styled nowiki added
Closed, ResolvedPublic8 Story Points

Description

There has to be an existing task about this but I can't seem to find it.

In https://en.wikipedia.org/w/index.php?diff=662007607, the following line was added:
* [[Proton beam writing|'''Proton beam writing''']] '''<nowiki/>'''uses a focused beam of high energy…

This issue us similar to T98887 in that it resulted in an empty styled nowiki, but the cause seems to be different (there weren't any pre-existing unbalanced quotes in this case).

Event Timeline

gpaumier created this task.May 12 2015, 4:35 PM
gpaumier raised the priority of this task from to Needs Triage.
gpaumier updated the task description. (Show Details)
gpaumier added a subscriber: gpaumier.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 12 2015, 4:35 PM
Elitre added a subscriber: Elitre.May 12 2015, 7:33 PM
Jdforrester-WMF set Security to None.
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

Parsoid-caused issue?

This is newly inserted content. Parsoid received empty <b> content, i.e .<b></b> and the only way to serialize that would be to insert a <nowiki/> there. So, this is more an issue of VE generating an empty bold annotation.

This is newly inserted content. Parsoid received empty <b> content, i.e .<b></b> and the only way to serialize that would be to insert a <nowiki/> there. So, this is more an issue of VE generating an empty bold annotation.

Certainly that would cause Parsoid to emit this, but VE doesn't have a way to apply <b> annotations to a zero-length string, so I'm not sure that was what happened? @Esanders, thoughts?

Jdforrester-WMF triaged this task as Normal priority.Jun 3 2015, 9:07 PM
ssastry moved this task from Backlog to Needs Discussion on the Parsoid board.Jun 8 2015, 10:24 PM

I encountered this bug in my volunteer editing, and after literally two hours I have now figured out how to consistently reproduce it (in both Firefox and Chrome)! I use bolding in my instructions below, but it works with italics as well. Doing it with other types of annotations will produce empty style tags (e.g. <sub></sub>), but not, of course, a <nowiki/>.

Instructions

  1. Create a VE document consisting of two words (let's call them A and B) with a space in between, all bold (equivalent to a wikitext of '''A B''').
  2. Select A (but not the space following it) and unbold it.
  3. Move your cursor directly before B (not directly after A) and add a space.
  4. Select that space (the second one between A and B, not the first) and hit bold.

And voilà! This gives us the linear model data

0. paragraph
1. A
2.   [{"type":"textStyle/bold"}]
3.  
4. B [{"type":"textStyle/bold"}]
5. /paragraph

which parses into wikitext as A '''<nowiki/>''' '''B'''.

Catrope added a subscriber: Catrope.EditedJun 13 2015, 12:11 AM

This was probably caused by 8dc8b266761dd424e386968f8c8f171d4eaa4461. The linmod conceptually means <p>A<b> </b> <b>B</b></p> but the code introduced in that change evacuates leading and trailing whitespace from annotation tags, so we end up with <p>A <b></b> <b>B</b></p> instead. We could address this by dropping annotation tags that are left empty by the whitespace evacuation code.

Change 218111 had a related patch set uploaded (by Catrope):
Follow-up 8dc8b266761d: if whitespace stripping empties an annotation node, drop it

https://gerrit.wikimedia.org/r/218111

Change 218111 merged by jenkins-bot:
Follow-up 8dc8b266761d: if whitespace stripping empties an annotation node, drop it

https://gerrit.wikimedia.org/r/218111

Jdforrester-WMF closed this task as Resolved.Jun 16 2015, 7:58 PM
Jdforrester-WMF assigned this task to Catrope.
Jdforrester-WMF edited a custom field.

It appears that this is fixed.