Make WordPress Core

Opened 12 years ago

Closed 7 years ago

#28762 closed defect (bug) (duplicate)

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

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

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 12 years ago.
added unit to check if handle self closing tag
Autop.php.2.patch​ (14.1 KB ) - added by pbearne 12 years ago.
patch with some more tests :-)

Download all attachments as: .zip

Change History (9)

@pbearne
12 years ago

added unit to check if handle self closing tag

#1 @pbearne
12 years ago

  • Keywords has-unit-test added

added quick unit to confirm

@pbearne
12 years ago

patch with some more tests :-)

#2 @tomauger
12 years ago

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

#3 @SergeyBiryukov
12 years ago

  • Component General → Formatting
  • Focuses template removed
  • Keywords has-unit-tests added; has-unit-test removed

Related: #18136, #20444, #21689.

#4 @miqrogroove
12 years ago

  • Keywords wpautop added

#5 @ericlewis
12 years ago

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

#7 @pento
7 years ago

  • Resolution → duplicate
  • Status new → closed

Duplicate of #14674.

Note: See TracTickets for help on using tickets.