WordPress.org

Make WordPress Core

Opened 7 years ago

Last modified 3 months ago

#3833 reopened defect (bug)

Extra </p> inside blockquote — at Version 4

Reported by: audwan Owned by: anonymous
Milestone: Future Release Priority: normal
Severity: normal Version: 2.7
Component: Formatting Keywords: has-patch needs-unit-tests wpautop
Focuses: Cc:

Description (last modified by foolswisdom)

When using blockquote </p> is inserted directly in front of </blockquote>, making the code invalid XHTML.

Example:

<blockquote>This is a blockquote</blockquote>

Gives the following result:

<blockquote>This is a blockquote</p></blockquote>

Seems like this forum thread adresses the same issue in the support forum.

Change History (4)

comment:1 foolswisdom7 years ago

  • Milestone changed from 2.1.3 to 2.2

comment:2 rob1n7 years ago

  • Milestone 2.2 deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Using <blockquote> inside <li> is invalid. Use <q> instead.

For me, <blockquote>Hello, world. Wonder what this will do.</blockquote> puts <p>...</p> inside the <blockquote> fine.

This is with r5142. Closing as worksforme.

comment:3 Goingthewongway6 years ago

  • Resolution worksforme deleted
  • Status changed from closed to reopened
  • Version changed from 2.1 to 2.3.1

On version 2.3.1 this is still an issue.

For example, a post with only <blockquote>some quote</blockquote> will result in <blockquote>some quote</p></blockquote>, which is invalid XHTML.

This seems to me to be a result of:

  1. formatting.php:78 $pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee);
  2. not having/not adding an opening "<p>" tag at the beginning of the post (even though it does get added for other all-text entries)

comment:4 foolswisdom6 years ago

  • Description modified (diff)
  • Keywords wpautop autop added
  • Priority changed from low to normal

ENV: WP trunk r6301

Confirmed bug exists as described.

The bug won't reproduce if there are no blank lines before the blockquotes, or if there is a paragraph before the blockquote. That likely explains it working for rob1n .

Repro having a block quote by the only text, inserted using visual editor.

Removed that part about blockquote in a list from description.

Note: See TracTickets for help on using tickets.