#37328 closed defect (bug) (duplicate)
Empty <p> tag inside <figure> markup
| Reported by: | henry.wright | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Formatting | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
<figure> <img src="image.png" alt=""> <figcaption>Caption</figcaption> </figure>
Using the above markup in the form at Posts > Add New results in an empty <p> tag being output. For example:
<figure> <img src="image.png" alt=""><p></p> <figcaption>Caption</figcaption> </figure>
Interesting, if I remove all whitespace from the markup I enter in the post form:
<figure><img src="image.png" alt=""><figcaption>Caption</figcaption></figure>
... I get a <br> tag instead of the <p></p>:
<figure><img src="image.png" alt=""><br> <figcaption>Caption</figcaption> </figure>
I believe the empty <p> is a bug with wpautop().
Change History (5)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
@henry.wright
So what happens if you disable the wpautop filter?
https://codex.wordpress.org/Function_Reference/wpautop