Title: Invalid HTML
Last modified: August 21, 2016

---

# Invalid HTML

 *  Resolved [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * (@awelzel)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/invalid-html-4/)
 * I just updated to version 1.1.0 and have invalid HTML again 🙁
 * If I check the output, I see there is a problem with its structure:
 *     ```
       <figure>
       <div><a><img></a></div>
       <p><figcaption></figcaption><br />
       </figure>
       </p>
       </div>
       ```
   
 * 1) The <p> element starts within <figure> but closes afterwards!
    2) BR-elements
   are not allowed within <figure>
 * The problem seems is the use of \n and \t in cleaner-gallery/inc/gallery.php –
   since the default WordPress wpautop filter replaces newlines in the output with
   or adds <p>…</p> if something looks like a paragraph.
 * After I removed all “\n” and “\t”, everything looks OK again.
 * Please consider this for the next update. If you want to make the HTML look “
   nice” – ok, but take care not to create line breaks or empty lines which may 
   create problems with wpautop
 * [https://wordpress.org/plugins/cleaner-gallery/](https://wordpress.org/plugins/cleaner-gallery/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Justin Tadlock](https://wordpress.org/support/users/greenshady/)
 * (@greenshady)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/invalid-html-4/#post-5090694)
 * This plugin has always had line breaks added into it. That’s nothing new.
 * It sounds like you have a plugin or theme function that’s doing something it 
   shouldn’t be doing. It’s possible that one of them is switching some default 
   content filters around (shortcodes are run *after* `wpautop()`).
 *  Thread Starter [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * (@awelzel)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/invalid-html-4/#post-5090695)
 * Indeed – on fresh demo setup ([http://arnowelzel.de/wpdemo/](http://arnowelzel.de/wpdemo/))
   it works fine.
 * So I have to investigate. I really like WordPress… but these wpautop issues are
   really very annoying.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Invalid HTML’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/cleaner-gallery_cfd5de.svg)
 * [Cleaner Gallery](https://wordpress.org/plugins/cleaner-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cleaner-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cleaner-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/cleaner-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cleaner-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cleaner-gallery/reviews/)

## Tags

 * [invalid html](https://wordpress.org/support/topic-tag/invalid-html/)
 * [wpautop](https://wordpress.org/support/topic-tag/wpautop/)

 * 2 replies
 * 2 participants
 * Last reply from: [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/invalid-html-4/#post-5090695)
 * Status: resolved