Page MenuHomePhabricator

Typing consecutive spaces into the iOS section editor converts every other space to a NBSP, which can break templates
Closed, ResolvedPublic

Description

Repro steps

  1. Open https://test.wikipedia.org/wiki/Template
  2. Tap the edit pencil on the first section
  3. Replace the spaces between name and = and cover and = with spaces entered by the iOS keyboard
  4. Submit the edit

Expected

Resulting article has a functioning template

Actual

Resulting article has a broken template

Original report

This edit and this edit (the | victims = parameter), both tagged as "ios app edit", changed regular spaces to non-breaking spaces (NBSP) in similar patterns within template parameter assignments. This breaks the parameter assignments, in this case causing the corresponding items in the infobox to not be displayed, but it can break templates more severely.

These character substitutions, with the pattern of alternating regular spaces and NBSPs, look unlikely to be caused by the person making the edit.

Steps to reproduce

I don't have an iOS device, so I can't reproduce such an edit.

Expected results

Editing should not cause spaces to be changed to NBSPs in template parameter assignments.

Actual results

Spaces were changed to NBSPs in template parameter assignments.

Environments observed

Page revision history, edits with "ios app edit" tags

Event Timeline

@FredTC This is the bug you reported at enwiki's Village pump miscellaneous last week.

@JoeWalsh, a question when you have found the cause of this bug:

Would it be possible for this bug to cause an NBSP that is in a parameter assignment but is not between the parameter name and the =, or is not in a parameter assignment at all?

I think I have encountered this before knowing about the invisible NBSP. I removed a space in Wikivoyage in "lat=" and/or "long=" between the = and the value. After doing this the marker appeared on the map.

@Pipetricker this bug causes a NBSP any time the user enters two consecutive spaces, so it isn't limited to parameter assignment or any particular part of wikitext

I suggest changing the title of this bug to "Consecutive spaces changed to NBSPs, which can break templates", or something like that.

JoeWalsh renamed this task from Spaces changed to NBSPs in template parameter assignments, breaking the assignment to iOS section editor converts every other consecutive space entered into NBSPs, which can break templates.Mar 27 2019, 5:31 PM
JoeWalsh renamed this task from iOS section editor converts every other consecutive space entered into NBSPs, which can break templates to iOS section editor converts every other consecutive space typed into NBSPs, which can break templates.
JoeWalsh renamed this task from iOS section editor converts every other consecutive space typed into NBSPs, which can break templates to Typing consecutive spaces into the iOS section editor converts every other space to a NBSP, which can break templates.

Just a thought: Could the breaking of templates by misplaced NBSPs be avoided by changing MediaWiki's parameter handling to treat NBSPs like other whitespace characters in assignments?

JMinor subscribed.

Thanks for reporting and following up folks. This shipped to the app store on Monday. Download the latest version to see the fix.