Page MenuHomePhabricator

Spacing before typing in old WikiEditors causes empty-character spacing duplication under CodeMirror mode in Modern, MonoBook, and Timeless skins
Closed, DeclinedPublic

Description

I switched to Modern skin and then MonoBook skin to test out the syntax highlighting feature at IE11.

When I began the line by pressing the space bar, I saw one empty character highlighted. I entered space some more, entered a word, and then pressed Enter. Then the empty characters from one line duplicates into another line. Also, the text cursor starts at the point between the space and the first word.

Nevertheless, when I removed the spaces, entered some words, and hit Enter, the cursor starts at the beginning.

Left image comes from Modern; right, MonoBook.

EDIT: I now realize that the issue extends to other browsers, like Chrome and Firefox, and another skin, Timeless.

Event Timeline

gh87 created this task.Mar 29 2018, 3:09 AM
gh87 renamed this task from Spacing before typing in old WikiEditors causes empty-character spacing duplication under CodeMirror mode in IE11 (Modern and MonoBook skins) to Spacing before typing in old WikiEditors causes empty-character spacing duplication under CodeMirror mode in Modern, MonoBook, and Timeless skins.Mar 29 2018, 9:10 AM
gh87 edited projects, added Timeless; removed Browser-Support-Internet-Explorer.
gh87 updated the task description. (Show Details)
Niharika added a subscriber: Niharika.EditedMar 29 2018, 8:26 PM

This is not a bug, this in the intended functionality. The empty character is highlighted to make it easy for the editor to know that they are adding preformatted text. It makes editing much easier because the character is automatically inserted on every line until you delete it and then it doesn't get copied anymore.
See Preformatted text section on https://www.mediawiki.org/wiki/Help:Formatting for more information.

TBolliger added a subscriber: TBolliger.

Close as invalid?

To clarify,

the empty characters from one line duplicates into another line. Also, the text cursor starts at the point between the space and the first word.

I think is also intentional (not just that the initial space is automatically inserted). The idea here being that people sometimes use the preformatted text for multi-line examples, where indentation is important. e.g.

Heading
  Foo
  Bar

  Sub-heading
    Foo
    Bar

Bad example maybe, but anyway if you type this in line by line, you'll see how the automatic indentation makes it easier.

gh87 added a comment.EditedMar 30 2018, 12:41 AM

Strange (or weird) that it's intended for it applies to only those using the CodeMirror mode but not for ones not using it. Ah well, close it if you wish.

TBolliger closed this task as Declined.Apr 2 2018, 4:11 PM
gh87 removed a subscriber: gh87.Apr 2 2018, 7:17 PM