Opened 8 years ago
Last modified 6 years ago
#37672 new defect (bug)
wpautop adds a closing p-tag without an opening p-tag
Reported by: | TBarregren | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 4.5.3 |
Component: | Formatting | Keywords: | has-patch has-unit-tests needs-testing needs-refresh |
Focuses: | Cc: |
Description
Following code result in ill-formed HTML.
<?php $pee = <<<EOT <div> This is a paragraph. This is another paragraph. </div> EOT; echo wpautop($pee);
This is the output:
<div> This is a paragraph.</p> <p>This is another paragraph. </p></div>
As you can see, the first paragraph lacks an opening <p>.
Attachments (1)
Change History (6)
#3
@
8 years ago
@TBarregren
Thank for your report - I can reproduce this with a unit test and I think I've also managed to create a fix in the 'wpautop()' function. Patch and Unit test attached above.
#5
@
6 years ago
- Keywords needs-refresh added
@MattyRob are you able to refresh 37672.diff to apply cleanly to trunk
? Having a unit test demonstrating the issue may help others dive in.
Note: See
TracTickets for help on using
tickets.
If it is to any help, this is my function.php code to solve this (and related) problem(s).