Make WordPress Core

Opened 20 years ago

Closed 20 years ago

Last modified 3 years ago

#3476 closed defect (bug) (duplicate)

<object> elements should not be put on their own line by wpautop

Reported by: Viper007Bond Owned by:
Priority: high Milestone:
Component: General Version: 2.1
Severity: major Keywords: needs-patch
Cc: Focuses:

Description

I don't know where to begin, but it needs a major overhaul.

For example, make a post with this:

Test<object>Blah</object>

That's perfectly valid XHTML.

It results in this:

<p>Test<br />
<object>Blah</object>

No closing </p> and a <br /> that shouldn't be there.

It also really likes putting <br />'s inside <object> tags even when there was no line break there.

The list goes on an on and it affects more than just <object> tags. As I said, I dunno where to start...

Change History (4)

#1 @JeremyVisser
20 years ago

I presume it's there because people post YouTube videos on the same line as the text, making the last line of the text go down to the bottom of the video.

But yeah, that's a bit funky.

#2 @foolswisdom
20 years ago

  • Summary wpautop is a mess → <object> elements should not be put on their own line by wpautop

#3 @rbeentje
20 years ago

The issue with new lines is a bug, as far as I can see, rather than any behavioral choices.

Looking at Revision 4672:
​http://trac.wordpress.org/browser/branches/2.0/wp-includes/functions-formatting.php?rev=4672

Line 68 adds a linebreak before block-level tags, for code appearance (as far as I can tell). However, line 80 converts linebreaks left over after auto-paragraphing to <br />s - so all that lovely code formatting is converted to visible formatting.

My solution has been to move lines 68 and 69 to the bottom of the function, because as far as I know these are only for code formatting.

Anybody in the know care to comment?

#4 @Viper007Bond
20 years ago

  • Milestone 2.1
  • Resolution → duplicate
  • Status new → closed

#3621 is more detailed.

Note: See TracTickets for help on using tickets.