• Resolved antforshaw

    (@antforshaw)


    Hi,
    Using W3TC and I have just noticed that it is inserting spurious line breaks (<br>) into the code when they are not in the source code.

    For example:

    <form id="lawyer-search" method="POST" action="/">
    <div id="find-a-lawyer" class="sm-12 input-group">
    				<input id="lawyer-name" class="ui-autocomplete-input" name="lawyer-name" size="100" type="text" placeholder="Know the Lawyer you're looking for?" required="" autocomplete="off"><br>
    				<input type="hidden" name="lawyer-search" value="1"><br>
    				<span class="input-group-btn"><br>
    					<input type="submit" value="" style="min-width:auto;" class="btn btn-default" name="lawyer-submit"><i class="fa fa-search"></i><br>
    				</span>
    			</div></form>

    After the <input> tags there are now <br> tags that are breaking the format of the input field – it is now too large.

    Any ideas? Does minify/combine cause this?

    Many thanks in advance,

    Anthony

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @antforshaw

    Thank you for reaching out and I am happy to help!
    The only thing that may cause this and related to W3TC is the HTML minify. And more specifically the HTML Tidy minify method.
    The HTML Tidy library, like HTML Minify (default) also removes most of the extraneous white space but also attempts to correct any mistakes in the HTML markup. For example, take the following HTML code:

    <i><h1>heading</h1><i> 
      <p>new paragraph <b>bold text 
      <p>some more bold text</b> <!-- This is the end of the bold text --> 
      <ul> 
        <li>1st list item 
        <li>2nd list item

    Tidy will resolve incorrectly nested elements, close elements that haven’t been closed, and try to resolve any tags that might be missing the closing slash character. The code above will be converted to:

    <h1><i>heading</i></h1> 
    <p>new paragraph <b>bold text</b></p> 
    <p><b>some more bold text</b></p> 
    <ul> 
    <li>1st list item</li> 
    <li>2nd list item</li> 
    </ul>

    I hope this helps!
    Thanks!

    Thread Starter antforshaw

    (@antforshaw)

    Hi Marko,

    Thanks for getting back to me. In the W3TC settings I have minify disabled and the spurious line breaks are still appearing. I’m stumped!

    I guess I should look elsewhere for the cause – if W3TC minify is disabled then this shouldn’t be an issue should it? Saying that, the only changes to the website lately were to enable W3TC!

    Many thanks,

    Anthony

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @antforshaw

    Thank you for the information.
    Yes, you are correct, the minify is the only thing that may be affecting this.
    If the issue persists when Minify is disabled, then it’s not related to W3 Total Cache.
    Thanks!

    Thread Starter antforshaw

    (@antforshaw)

    Quick one – does W3TC change the order of any of the filters? (Thinking wpautop here specifically)

    Many thanks,

    Anthony

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @antforshaw

    No, W3 Total Cache does not change the order of the filters.

    Thnaks!

    Thread Starter antforshaw

    (@antforshaw)

    Great, that eliminates W3TC as a suspect 😀

    Many thanks,

    Anthony

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

The topic ‘W3TC inserts line break into the pages’ is closed to new replies.