WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#11024 closed defect (bug) (fixed)

Invalid xhtml output from both TinyMCE and wpautop

Reported by: thomask Owned by:
Milestone: 2.9 Priority: high
Severity: trivial Version: 2.8.4
Component: Validation Keywords: reporter-feedback
Focuses: Cc:

Description

if you have anchor just before the closing div tag, the paragraph of the previous line is not closed. You can try to type the code at the end of this ticket to html editor and switch to tinymce - it automaticaly strips out the blank line before the closing div, so the result is

<div>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. <a href="http://www.example.com">Ut enim ad minim veniam</a></div> 

So the error is both in tinymce (it should not strips out the blank line) and in wpautop function (or other which formats text) which should find that there is not closed P tag before the closing div. The error appears even if you have checked "let wordpress repair the xhtml errors" option.

<div>

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. <a href="http://www.example.com">Ut enim ad minim veniam</a>

</div> 

Change History (5)

comment:1 scribu4 years ago

  • Milestone changed from Unassigned to 2.9

comment:2 scribu4 years ago

  • Summary changed from invalidate xhtml output from both tinymce and wpautop to Invalid xhtml output from both TinyMCE and wpautop

comment:3 azaozz4 years ago

Cannot reproduce this in trunk. Pasting the example code in the HTML editor produces valid output, even pasting

<div><p>text <a href="#">link</a></div>

is corrected and still produces valid output.

The browser (and TinyMCE) don't really care about blank lines/hard returns in the contentEditble iframe as in HTML they are not significant except in a <pre> tag.

comment:4 scribu4 years ago

  • Keywords reporter-feedback added

comment:5 azaozz4 years ago

  • Keywords wpautop xhtml removed
  • Resolution set to fixed
  • Status changed from new to closed

No feedback, probably fixed in the latest TinyMCE. Feel free to reopen if it still happens.

Note: See TracTickets for help on using tickets.