Page MenuHomePhabricator

Default whitespace for headings should have two new lines beforehand (i.e., one blank line before a heading)
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. Go into a heading
  1. Change heading level from 2 to 3 (i.e.)

Expected output: Only the number of = should change

Actual output: Number of = is changed correctly but the newline before the heading is moved under the heading now.


Version: unspecified
Severity: enhancement
URL: https://de.wikipedia.org/w/index.php?title=Benutzer:Raymond/heading&diff=119444161&oldid=119444142

Details

Reference
bz49428

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:08 AM
bzimport set Reference to bz49428.

Indeed; a newline above or below a heading will be trimmed when the heading is changed in some manner. Is this Parsoid's behaviour?

https://www.mediawiki.org/w/index.php?title=VisualEditor:Bug_49428&diff=715815&oldid=715814

Replacing a heading is the same a removing the old one and inserting a new one (transactionally speaking), so all the (non visible) whitespace information will be lost.

The output on the right is what you'd get if you created the document from scratch and as you are making structural changes, rather than changes within a paragraph, it is arguably by design that we throw away any old quirks in the wikitext for that section.

On a separate note, the standard spacing around headings (on en.wiki at least) appears to be:

Foo

Bar

Baz

Where Parsoid renders:

Foo

Bar

Baz

I believe they have a default whitespace setting that could fix this so this could be raised as a Parsoid bug.

(In reply to comment #3)

I believe they have a default whitespace setting that could fix this so this
could be raised as a Parsoid bug.

Marking as such.

Related URL: https://gerrit.wikimedia.org/r/70214 (Gerrit Change Id8e5b87602e3ba0f0e1cf6b5c6e03f4949e7d053)

https://gerrit.wikimedia.org/r/70214 (Gerrit Change Id8e5b87602e3ba0f0e1cf6b5c6e03f4949e7d053) | change APPROVED and MERGED [by jenkins-bot]