Make WordPress Core

Opened 5 years ago

Closed 9 months ago

#33584 closed defect (bug) (wontfix)

New lines before content get removed

Reported by: dgwatkins Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Editor Keywords:
Focuses: Cc:


If you add a few blank lines (in text mode) before the content and save, you will see the first blank line is trimmed.

If you save again, the second blank line gets removed.

You can go on until you have no blank lines left.

I made a short video showing the behaviour: https://youtu.be/26C2kdhJfBE

Attachments (1)

patch-33584 (734 bytes) - added by dgwatkins 5 years ago.
Lost newlines patch

Download all attachments as: .zip

Change History (5)

#1 follow-up: @dgwatkins
5 years ago

I noticed the data gets saved correctly.

Its purely an HTML issue, more info here:

5 years ago

Lost newlines patch

#2 @obenland
5 years ago

  • Version trunk deleted

#3 in reply to: ↑ 1 @azaozz
5 years ago

  • Keywords close added

Replying to dgwatkins:

Its purely an HTML issue...

Right. Don't think we need to fix this browser behaviour. The white space doesn't do anything in HTML, and if the user wants to add an empty paragraph at the top of post content (yeah, it is bad HTML), we insert &nbsp; to keep the <p>.

#4 @desrosj
9 months ago

  • Keywords close removed
  • Resolution set to wontfix
  • Status changed from new to closed

Closing this out per @azaozz's recommendation. The behavior is likely different in the block editor now.

Note: See TracTickets for help on using tickets.