hmm … hard to say why this happens, but if you insist (the performance benefit is pretty close to non-existent) you could hook into AO’s API (the autoptimize_html_after_minify filter) to try to remove those linebreaks I guess. do you have any experience with PHP code/ WordPress filters?
Thank you for your answer! My experience with PHP/WP filters is like search, copy and paste where it should be, so I’m not very experienced in writing/debugging codes.
well, you could try this code snippet (no guarantees though, it *might* work but it *could* also break things);
add_filter( 'autoptimize_html_after_minify', function( $html ) {
return str_replace( array( '"\n', '"\r', ';\n', ';\r' ), '', $html );
});
I appreciate your effort! Unfortunately, the code snippet isn’t doing anything. That Crelly Slider HTML is still the same.
well, if it’s any comfort; the 10 or so newlines that leaves in the HTML has no measurable performance impact 😉
Yea, if there were only 10 lines… 😒</img>
https://ibb.co/8KdF3d2
even if you have 50 linebreaks the impact will be negligible as the HTML output is (or should be) compressed (deflate/ gzip or brotli) in transit at webserver level, so the difference likely is below 0.01KB 🙂