Page MenuHomePhabricator

New line after {{DISPLAYTITLE:}} should be ignored
Open, MediumPublic

Description

Typical article using {{DISPLAYTITLE:}} has that function on the first line, then line wrap and then infobox or start of the text.

Currently that creates empty paragraph on output -> the article content starts further down from headline than regular articles do.


Version: 1.18.x
Severity: normal

Details

Reference
bz34957

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:11 AM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz34957.
bzimport added a subscriber: Unknown Object (MLST).

I'm pretty sure that if we changed this we would see a lot of complaints as soon as it was deployed.

I'm pretty sure that it was working that way before update to weaken restrictions.

You should definitely change the behaviour to *not* add blank lines.

I've seen many articles on Wikipedia with ugly excessive vertical space after page title due to this error. Common templates (e.g. http://en.wikipedia.org/wiki/Template:Lowercase) even work around this issue by including the {{DISPLAYTITLE:}} template in a <span></span>.

I can't think of any case were newlines at the beginning of the page are actually needed so I can't imagine you'll break anything or receive any complaints.

Code update regression can't be marked as enhancement. Changing.

I think it would be good to revisit this a bit, maybe see if things have changed in the last 9 years.

I've hit this on ro.wiki and investigated. Turns out that the behavior is still present in some wikis, but not in en.wiki. You can use the following minimal test case:

{{DISPLAYTITLE:''{{PAGENAME}}''}}
{{taxobox}}
Lorem ipsum

On ro.wiki there is a visible empty line, while on en.wiki there isn't.

Screenshot_20210227-001706.jpg (2×1 px, 282 KB)
ro.wiki
Screenshot_20210227-001635.jpg (2×1 px, 303 KB)
en.wiki

The worse is that you mileage might vary even on the same site. Compare the code above with

{{DISPLAYTITLE:''{{PAGENAME}}''}}
{{Infocaseta Monument}}
Lorem ipsum

The second snippet does not generate an empty line on either project.