Make WordPress Core

Opened 11 years ago

Closed 6 years ago

#28762 closed defect (bug) (duplicate)

Self-closing HTML tags create orphaned closing </p> tag in wpautop

Reported by: maimairel's profile maimairel Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.9.1
Component: Formatting Keywords: has-unit-tests wpautop
Focuses: Cc:

Description

When using self closing tags like <hr> followed by a line of text separated by newline, wpautop returns invalid HTML.

Consider the following example:

<hr>
test

When inserting this into WordPress editor in text mode, the_content will return the following invalid HTML:

<hr>
test</p>

Attachments (2)

Autop.php.patch (1.1 KB) - added by pbearne 11 years ago.
added unit to check if handle self closing tag
Autop.php.2.patch (14.1 KB) - added by pbearne 11 years ago.
patch with some more tests :-)

Download all attachments as: .zip

Change History (9)

@pbearne
11 years ago

added unit to check if handle self closing tag

#1 @pbearne
11 years ago

  • Keywords has-unit-test added

added quick unit to confirm

@pbearne
11 years ago

patch with some more tests :-)

#2 @tomauger
11 years ago

Thanks @maimariel for your bug report. The tests confirm what you are reporting and this should be addressed soon!

#3 @SergeyBiryukov
11 years ago

  • Component changed from General to Formatting
  • Focuses template removed
  • Keywords has-unit-tests added; has-unit-test removed

Related: #18136, #20444, #21689.

#4 @miqrogroove
10 years ago

  • Keywords wpautop added

#5 @ericlewis
10 years ago

  • Summary changed from wpautop and HTML self closing tags to Self-closing HTML tags create orphaned closing </p> tag in wpautop

#7 @pento
6 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #14674.

Note: See TracTickets for help on using tickets.