Opened 8 years ago
Closed 5 years ago
#40135 closed defect (bug) (duplicate)
wpautop adds a extra </p>
Reported by: | jim5471 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.7.3 |
Component: | Formatting | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
This is similar to bug reported here #39307
post content
<div><img src="/wp-content/uploads/example.jpg" alt="something" /><div>Something</div></div>
generated markup - note wrong </p> after <img>
<div><img src="/wp-content/uploads/example.jpg" alt="something" /></p> <div>Something</div> </div>
Attachments (2)
Change History (8)
#4
@
7 years ago
I am new here :) really didn't know how to show the code that i have written like others!
i wrote this line of code for fixing this bug and also have tested
<?php $pee = preg_replace('/(img\s)?(^">|<\/p>)/', "", $pee);
Version 0, edited 7 years ago
by
(next)
#5
@
7 years ago
- Keywords has-patch 2nd-opinion added
More information About test:
1- Firstly I entered some inline HTML without any whitespace including <img /> using only text mode on the editor and saved directly!
2- then i checked post source and i found that wpautop has added <p></p> after ending <img /> tag.
3- After some research added a new Regex line at /wp-includes/formatting.php and tested again with same process and Bug has been resolved
Note: See
TracTickets for help on using
tickets.
Related: #18136, #39377.