Visual editor: issues with removing leading space pre blocks
OpenPublic

Description

When a page with blocks of pre-formatted text that use the leading space in wikitaxt is edited in Visual Editor there are various issues trying to remove the pre-formatted blocks. https://en.wikipedia.org/w/index.php?title=User:Thryduulf/sandbox&oldid=565085889 can be used for testing.

  • It is not possible to delete a block on the first line of a page
  • When the pre-formatted block follows a mutli-line template, that template is deleted and the contents of the pre-formatted block becomes normal text on the line above where the template as, appended to any text that was already there.
  • When the pre-formatted block follows a normal line of text or a single line template the contents of the block are appended to the end of that line.
  • When the block follows indented text, the contents are appended to the last line of the indented block, even if that is a line that doesn't exist in wikitext (see T52995: VisualEditor: Backspace from (or deleteing down) into a DL breaks badly)
  • When the block follows an ordered or unordered list, the text is appended to the last line of the last item in the list

*When the block follows an image, the contents are appended to the image caption. This is probably depends on T53624: VisualEditor: Delete immediately before (or backspace after) a table cell moves text out of/into cell and so I would expect the same behaviour with tables, but I have not tested that.
*If the block follows another pre-formatted block, the contents gets appended to the end of that block.

In all cases this can be worked around by inserting and then backspacing a new line at the start of the block.

In cases when there is a line of normal text, a blank line or a single line template before the pre-formatted block then pressing delete at the end of that line appends the contents of the block at the cursor position as normal text.

The differing behaviour of single and multi-line templates may be related to T53708: VisualEditor: Inline templates don't wrap, assume width:100%, so break layout around floated items


Version: unspecified
Severity: normal

bzimport set Reference to bz51758.
Thryduulf created this task.Via LegacyJul 20 2013, 7:13 PM
Spinningspark added a comment.Via ConduitSep 8 2013, 3:36 PM

In this edit https://en.wikipedia.org/w/index.php?title=Morse_code&diff=571916446&oldid=571809074 the multiple leading spaces of a pre-formatted block have been removed while a totally unrelated line was being edited. The edit summary gives no indication that this was done deliberately so I am assuming this was the result of a bug in VisEd.

Aklapper edited the task description. (Show Details)Via WebMar 4 2015, 4:13 PM
Aklapper set Security to None.
Aklapper added a subscriber: Aklapper.Via WebMar 4 2015, 4:23 PM
  • It is not possible to delete a block on the first line of a page

I managed after removing the text and then putting the cursor in front of the "Section 1" heading and pressing Backspace.

  • When the pre-formatted block follows a mutli-line template, that template is deleted and the contents of the pre-formatted block becomes normal text on the line above where the template as, appended to any text that was already there.

When exactly is "that template deleted"? Already by loading the page in VisualEditor? If so I fail to reproduce...

Thryduulf added a comment.Via WebMar 5 2015, 10:09 AM
  • When the pre-formatted block follows a mutli-line template, that template is deleted and the contents of the pre-formatted block becomes normal text on the line above where the template as, appended to any text that was already there.

When exactly is "that template deleted"? Already by loading the page in VisualEditor? If so I fail to reproduce...

From memory, what I meant by that was that when you have a template that produces more than one line of text that is immediately followed by a block of pre-formatted text that uses the leading space method (i.e. not <pre> tags), removing the leading space also deletes the preceding template and the linebreak between the template and the paragraph above the template. i.e.

Paragraph one.
Template
[space]two

becomes

Paragraph one.two

when you try to delete [space]. I don't have time now to test whether this still happens.

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.