WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 5 years ago

#4041 closed defect (bug) (duplicate)

Some HTML (br and empty p tags) stripped when opening post in editor.

Reported by: mellis Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.2
Component: Administration Keywords: autop
Focuses: Cc:

Description

I edited a post in the code view of the editor and manually inserted a <br /> tag in order to create some extra white space. When I saved the post, the tags were removed. Then I tried to insert <p>&nbsp;</p> and clicked "save and continue editing". The extra space appeared in the post preview, but when I clicked on the code tab of the editor, the tags had disappeared. If I clicked "save and continue editing" again, the space and tags were gone.

I'm guessing that Wordpress (perhaps the visual editor in particular) is automatically stripping these "empty" tags. Since, however, I've manually inserted them into the HTML of the post, I consider this behavior a bug (especially as I don't see any options for turning off the visual editor). Is there any way to prevent Wordpress from modifying my HTML?

Change History (4)

comment:1 foolswisdom7 years ago

  • Milestone changed from 2.4 to 2.3
  • Version set to 2.2

WORKAROUND: Enter "&nbsp;<br />" each time.

Relates to Idea: Let us force a line break

comment:2 in reply to: ↑ description bentrem6 years ago

Replying to mellis:

I edited a post in the code view of the editor and manually inserted a <br /> tag

[...]

I'm guessing that Wordpress (perhaps the visual editor in particular) is automatically stripping these "empty" tags.

This is one of a flock of such complaints, here and in Support.
If there isn't a general ticket maybe there should be.
If there is then this one should be ?what? closed or whatevuh.

comment:3 lloydbudd6 years ago

  • Keywords autop added

comment:4 Denis-de-Bernardy5 years ago

  • Milestone 2.9 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

there's a dup of this one in the formatting component

Note: See TracTickets for help on using tickets.