Make WordPress Core

Opened 15 years ago

Closed 10 years ago

#11202 closed defect (bug) (duplicate)

automatic line breaks in comments

Reported by: dunkelangst's profile Dunkelangst Owned by:
Milestone: Priority: low
Severity: normal Version: 2.8.5
Component: Formatting Keywords: wpautop
Focuses: Cc:

Description

WordPress 2.8.6 has got a Problem with the automatic line break.
Example:
Type the following comment in a WordPress Blog.

Thank you for your comment!<blockquote>this is a small quote</blockquote> Next Text 

Then you have to save the comment. If you validate the your publish, you will see, that the sentence "Thank you for your comment!" will be put into the following absurd tags:

p>Thank you for your comment!<br />

If you write a comment with the following code (hit return after the word comment! ),

Thank you for your comment! 
<blockquote>this is a small quote</blockquote> Next Text 

you will get the right codeform when you validate your comment:

<p>Thank you for your comment!</p> 

The same Problem exists when you type

test 2 <p> break </p> next text

After the word test 2 you will miss the </p>.

WordPress has got this bug with every single elements like these one:

<p>, <ul>, <ol>, <li>, <h1> bis <h6>, <div>, <blockquote> etc.

When you make manuell a new line in front of these elements, you won't find any problem, so WordPress must put an automatic line break in front of these elements and it doesen't do it. Please fix this nerved bug!!

regards, Dunkelangst from http://www.dunkelangst.org/

Change History (8)

#1 @Denis-de-Bernardy
15 years ago

  • Component changed from General to Formatting
  • Milestone changed from Unassigned to 3.0

many dups of this

#2 follow-up: @azaozz
15 years ago

  • Summary changed from automatic line break to automatic line breaks in comments

Seems this would need something similar to the pre_wpautop function in editor.dev.js (in PHP of course) but a lot simpler since only few HTML elements are allowed in comments.

#3 in reply to: ↑ 2 @Denis-de-Bernardy
15 years ago

Replying to azaozz:

Seems this would need something similar to the pre_wpautop function in editor.dev.js (in PHP of course) but a lot simpler since only few HTML elements are allowed in comments.

It's actually much simpler to fix. I've submitted a patch for this in another wpautop ticket somewhere (Formatting component). The only thing that's needed to sort out most of wpautop bugs is to toss in a \n\n character before *and* after opening and closing block elements. It never got committed for some reasons. I still fail to see how such a thing could harm or break, but anyway...

#4 @Denis-de-Bernardy
15 years ago

The patch is over in #3833.

#5 @azaozz
15 years ago

The patch in #3833 forces any inline tags or text to be wrapped in <p> when they are inside another block element. Then it tries to fix only <li> by always removing the wrapping <p> from inside of it, but you won't be able to have things like <td>some text</td> or <div>some text</div>, etc.

Related #8644 and few more.

#6 @dd32
15 years ago

  • Keywords wpautop needs-patch added
  • Milestone changed from 3.0 to Future Release

No patch, No clear solution, Moving to a future release along with all the other wpautop bugs, They all need to be dealt with at the same time with a clear set of test cases.

#7 @chriscct7
10 years ago

  • Keywords close added

This seems to be a duplicate now of #3833, as the solution for that should fix this one simultaneously

#8 @DrewAPicture
10 years ago

  • Keywords needs-patch close removed
  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #3833.

Note: See TracTickets for help on using tickets.