Support » Plugin: Cleaner Gallery » Invalid HTML

  • Resolved Arno Welzel

    (@awelzel)


    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/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Justin Tadlock

    (@greenshady)

    WordPress God

    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()).

    Indeed – on fresh demo setup (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.