Page MenuHomePhabricator

Extra layer of transclusion adds linebreak when parsing
Closed, DuplicatePublic

Description

Apparently this bug has been known on English Wikipedia for a while and some of the more complicated templates have work-arounds for it. These workarounds are causing problems for the mobile site though, so we should fix the underlying issue (and create some unit tests for it).

To see this bug, compare:

Screen Shot 2017-04-28 at 3.02.22 PM.png (326×777 px, 57 KB)

Screen Shot 2017-04-28 at 3.01.46 PM.png (298×776 px, 56 KB)

The only difference between these two pages is that sandbox2 uses a template with 2 levels of transclusion and sandbox3 uses a template with 1 level of transclusion. In sandbox2, an extra linebreak is output at the beginning of the template, which changes the appearance of the article.