• Resolved donpi73

    (@donpi73)


    As the W3C Validation Service outputs many alert info messages about “Trailing slash on void elements has no effect and interacts badly with unquoted attribute values.”…

    Can you rewrite your HTML minify function to remove trailing slashes to void elements, as Autoptimize plugin has?

    Autoptimize can be configured to output void elements without trailing slashes, by using a filter with the autoptimize_html_after_minify hook — like this:

    add_filter( 'autoptimize_html_after_minify', function( $html ) {
        return str_replace( '/>', '>', $html );
    } );

    The page I need help with: [log in to see the link]

Viewing 2 replies - 16 through 17 (of 17 total)
  • Plugin Support qtwrk

    (@qtwrk)

    this is weird, I don’t see any reason why it would even take effect on admin area

    please create a ticket by mail to support at litespeedtech.com with reference link to this topic

    we will invstigate further.

    Thread Starter donpi73

    (@donpi73)

    I found the problem:

    You made a typo in your code suggestion: you wrote “strops” instead of “strpos”, and – as I had copy&pasted your code as is – it didn’t work ??

    Seems to work now.

    Thanks.

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘HTML minify: output void elements without trailing slashes’ is closed to new replies.