Make WordPress Core

Opened 11 years ago

Last modified 5 years ago

#25785 new defect (bug)

Unexpected Paragraph Formatting Within a Div Container

Reported by: emg's profile EMG Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.7
Component: Formatting Keywords: needs-patch needs-unit-tests
Focuses: Cc:


Though HTML mode in WordPress allows for the user to add in their own CSS styling and HTML content formatting if necessary, its normal behavior also makes it auto-format paragraph breaks without the user's input of paragraph tags. This is EXPECTED behavior.

I have discovered that in this specific manner of formatting when writing a post or page (note the LACK of spacing between the div tag and the content and the multiple paragraphs):

<div>Insert FIRST PARAGRAPH here.

Insert SECOND PARAGRAPH here.</div>

The end result (both visually and looking at the source code) is that there is a MISSING opening paragraph tag at the beginning of the first paragraph right after the opening div tag.

IF the user adds their own spacing between the divs and the content, paragraph formatting with happen on its own, but if the user doesn't add in the spacing and starts the paragraphed content right after the div like in the example above, the first paragraph tag isn't automatically added in.

For a screenshot of the end result source code that is generated (with the missing opening paragraph tag), please see the attached file.


Attachments (2)

WP-3-7-ParaTagMissing.png (54.1 KB) - added by EMG 11 years ago.
screenshot of the generated source code with the paragraph formatting error
25785.diff (672 bytes) - added by jorbin 10 years ago.
Unit Tests from MikeHansenMe originally from #30142

Download all attachments as: .zip

Change History (8)

11 years ago

screenshot of the generated source code with the paragraph formatting error

#1 @SergeyBiryukov
11 years ago

  • Component changed from Post Formats to Formatting

Related: #849, #3007, #3833, #4857.

#2 @nacin
10 years ago

  • Keywords wpautop added

#3 @nacin
10 years ago

  • Keywords needs-unit-tests added

This appears to be a duplicate of #3833 and/or others. Let's get a unit test.

#4 @nacin
10 years ago

  • Milestone changed from Awaiting Review to Future Release

10 years ago

Unit Tests from MikeHansenMe originally from #30142

#5 @jorbin
10 years ago

MikeHansenMe wrote some unit tests on #30142 for this. The above patch was originally written by him.

#6 @chriscct7
8 years ago

  • Keywords wpautop removed
Note: See TracTickets for help on using tickets.