WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 4 months ago

#33584 new defect (bug)

New lines before content get removed

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

Description

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 4 years ago.
Lost newlines patch

Download all attachments as: .zip

Change History (4)

#1 follow-up: @dgwatkins
4 years ago

I noticed the data gets saved correctly.

Its purely an HTML issue, more info here:
http://stackoverflow.com/questions/15529500/html-textarea-ignores-1st-new-line-character-why

@dgwatkins
4 years ago

Lost newlines patch

#2 @obenland
4 years ago

  • Version trunk deleted

#3 in reply to: ↑ 1 @azaozz
4 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>.

Note: See TracTickets for help on using tickets.