Page MenuHomePhabricator

Line break is missing when you insert a template after a list
Closed, DuplicatePublic

Description

Steps:

  1. Insert line break after list (press ENTER)
  2. In an empty line type "{{" -> template dialog appears.
  3. Type in template name (in my case pl-references template called "Przypisy").
  4. VE adds the template <del>and upon reviewing changes (diff) template is inserted in the new line</del>.

Expected:
Template should be in the new line and diff should be consistent with actual wiki-code being inserted.

Actual:
New line before the template is removed. And I'm not aware of any way to avoid this (I have to edit wiki-code and insert new line).

This is what got inserted: diff after save. Notice no line break between "." and "{{Przypisy}}".

Because that template transcludes the == Przypisy == section heading (meaning == References == in English), the wikitext markup for the section heading doesn't work, and == Przypisy == appears in plain text at the end of the previous paragraph.

Event Timeline

Nux created this task.Feb 18 2017, 5:05 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 18 2017, 5:05 PM
Whatamidoing-WMF updated the task description. (Show Details)

I wasn't able to reproduce this problem in my sandbox at the Polish Wikipedia.

As a workaround, have you tried adding two blank lines before the template?

Nux updated the task description. (Show Details)Feb 21 2017, 9:46 PM
Nux added a comment.Feb 21 2017, 9:52 PM

Edited to correct two things:

  1. Diff is actually fine. It's just that the template appears to be in new line when the line is long. When is short it is obvious the new line was not inserted before template.
  2. Problem only occurs when you try to insert the template after list. The problem does not occur when you insert the template in an ordinary paragraph.

Adding an empty line before the template does help. Thanks 😃

Whatamidoing-WMF renamed this task from Unable to insert line before template with VE to Line break is missing when you insert a template after a list.Mar 7 2017, 6:11 PM

Here's another example: https://en.wikipedia.org/w/index.php?title=User:Whatamidoing_(WMF)/sandbox&diff=768998494&oldid=768112567

Also, when you try to edit that later in visual mode, it turns the list and the template into a complex transclusion, so adding a simple line break to separate the list from the template becomes exceedingly difficult for approximately all the people in the world who are not the product manager.

This will be resolved by T138492: Add support for actual format strings to TemplateData's "format" parameter and adding the appropriate information into the template's TemplateData, I think.

Restricted Application removed a subscriber: Liuxinyu970226. · View Herald TranscriptMar 7 2017, 8:12 PM