Page MenuHomePhabricator

Pipe markup inserts an extra <p><br></p>, but HTML tables don't
Closed, ResolvedPublic

Description

Author: ui2t5v002

Description:
When a pipe markup table is placed after a heading with a newline between them,
an extra <p><br></p> is generated between them.

The renderer is supposed to ignore a single newline after a heading; it should
behave the same way whether there's a newline or not.

Tables done in HTML do not have this extra <p><br></p>, whether there is a
newline or not. See my example page.

I noticed this with templates with tables inside, but it also happens with other
templates. Template:main, for instance, has a colon as the first character, and
has the same problem when transcluded, but not when subst'ed.


Version: unspecified
Severity: normal
URL: http://en.wikipedia.org/wiki/User:Omegatron/Sandbox/ExtraBR

Details

Reference
bz4843

Revisions and Commits

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:04 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz4843.
bzimport added a subscriber: Unknown Object (MLST).

ui2t5v002 wrote:

Oh! And when subst'd, the pipe markup table and template:main both get an extra
newline added at the beginning. In other words:

Heading

{{subst:main|test}}

becomes:

Heading

:''Main article: [[test]]''

It gets an extra newline added before it. This does not happen with plain text
templates or ones with HTML table markup.

ui2t5v002 wrote:

Encasing the entire template in <span> tags gets rid of the extra newline, which
might act as a workaround for now.

qleah wrote:

Tables can also cause a <br> to be placed at the beginning of the following
paragraph if there are blank lines after the table. The last example in
[[User:Omegatron/Sandbox/ExtraBR]] has extra space following it because of this.

chinchi29 wrote:

Can't reproduce for the provided URL.

Diffusion closed this task as Resolved by committing Unknown Object (Diffusion Commit).Mar 4 2015, 8:16 AM
Diffusion added a commit: Unknown Object (Diffusion Commit).
Aklapper subscribed.

(Reopening due to accidential Diffusion activity (see task 91488))

matmarex subscribed.

I don't see the problem on the linked page any more. It was probably caused by T14974, but something special-cases empty lines before tables now.

en.wikipedia.org_wiki_User_Omegatron_Sandbox_ExtraBR(Laptop with medium screen).png (1×1 px, 190 KB)

qleah wrote:

Tables can also cause a <br> to be placed at the beginning of the following
paragraph if there are blank lines after the table. The last example in
[[User:Omegatron/Sandbox/ExtraBR]] has extra space following it because of this.

This is still the case, and it has been filed as T65912 in the meantime.