Opened 18 years ago
Closed 18 years ago
#3669 closed defect (bug) (fixed)
Missing close </p> tag in wpautop
Reported by: | scenic | Owned by: | |
---|---|---|---|
Milestone: | 2.2 | Priority: | high |
Severity: | normal | Version: | 2.1 |
Component: | Template | Keywords: | wpautop xhtml has-patch |
Focuses: | Cc: |
Description
wpautop seems to change <p><div></div></p> to <div><p></div>
(note the lack of a closing </p> in the second). This broke XHTML
compliance in some text appended by a custom plugin of mine, but I'm
guessing it would affect any div's I put in via the edit page.
I've attached the patch, but the short version of the fix is adding
this line below after line 66 in wp-includes/formatting.php.
$pee = preg_replace( '|(</div[>]*>\s*)</p>|', "</p>$1", $pee );
Attachments (1)
Change History (10)
#4
@
18 years ago
- Priority changed from low to high
This is cause plugins that generate <div> tags to fail. WPG2 is the prime example.
Could someone please explain what the extra lines (66-68) in [4565] do? I suggest backing that 3 lines out to fix this problem.
#7
@
18 years ago
- Milestone changed from 2.1.1 to 2.2
- Resolution fixed deleted
- Status changed from closed to reopened
I can still reproduce this bug. Running WordPress MU 1.2.1 (the wpautop()
function is currently exactly the same as in trunk with your fix).
Patch to fix this bug