Forums

WordPress in HTML mode adding unwanted line breaks and paragraph tags (9 posts)

  1. kerflop
    Member
    Posted 3 years ago #

    I am using WordPress for an ecommerce website paired with the shopping cart from Secure Net Shop. I am structuring the product pages with the cart code using HTML. When I paste the HTML into the WordPress page from Coda, WordPress adds line breaks and paragraph tags where I don't intend there to be any.

    I have line breaks in the code just for ease of editing and to create clean looking code. I really don't want to remove them all, the code would be a mess to edit. Is there a solution for this?

    For example, if I paste this into my WordPress page (again, visual editor is OFF):

    <li><strong class="pr">Price</strong> $17.00</li>
    	<li>
    		<label for="size">Choose Size</label><br />
    		<select name="option1|Size">
    		<option value="novalue" select>- Please Select -</option>
    		<option value="XS/Newborn">XS/Newborn</option>
    		<option value="Small|1.00">Small - Add $1.00</option>
    		<option value="Medium|2.00">Medium - Add $2.00</option>
    		<option value="Medium Long|3.00">Medium Long - Add $3.00</option>
    		<option value="Large|4.00">Large - Add $4.00</option>
    		<option value="Extra Large|6.00">Extra Large - Add $6.00</option>
    		</select>
    	</li>

    And then publish, I get warnings via my TIDY HTML Plugin as WordPress has turned the code into this:

    <li><strong class="pr">Price</strong> $17.00</li>
    <li>
    		<label for="size">Choose Size</label></p>
    <select name="option1|Size">
    		<option value="novalue" select>- Please Select -</option><br />
    
    		<option value="XS/Newborn">XS/Newborn</option><br />
    		<option value="Small|1.00">Small - Add $1.00</option><br />
    		<option value="Medium|2.00">Medium - Add $2.00</option><br />
    		<option value="Medium Long|3.00">Medium Long - Add $3.00</option><br />
    		<option value="Large|4.00">Large - Add $4.00</option><br />
    		<option value="Extra Large|6.00">Extra Large - Add $6.00</option><br />
    
    		</select>
    </li>

    See all those line break tags after the closing option tags? It's kind of odd, because it doesn't add them after everything.

  2. kerflop
    Member
    Posted 3 years ago #

    Does this question belong in the advanced forum?

  3. thisisedie
    Member
    Posted 3 years ago #

    Hey there! I'm not sure you can stop WP from automatically inserting line breaks. When I tested it it doesn't seem to mess up the output though, but maybe it causes problems submitting?

    I was really surprised when I was saw your name. I used to read your website all the time. Just found your new one :)

  4. kerflop
    Member
    Posted 3 years ago #

    Sure you can. It's just code. I just don't know how.

    Going to repost this in the advanced forum.

  5. kerflop
    Member
    Posted 3 years ago #

    Ugh, just kidding, can't post over there unless you're a moderator.

    Looking at this: http://wpbits.wordpress.com/2007/08/06/a-look-at-wordpress-filters-disable-wpautop-on-post-formatting/

    Anyone know *which* filter would need to be turned off? I don't want all HTML to be disabled, just the automatic line breaks.

    Help, anyone?

  6. briantjacobs
    Member
    Posted 2 years ago #

    I just ran into the same extra line break issue when pasting in code. Were you ever able to resolve this issue? I'm going to be pasting in a lot of 'tidy' code....

  7. briantjacobs
    Member
    Posted 2 years ago #

  8. briantjacobs
    Member
    Posted 2 years ago #

  9. newbie_geek
    Member
    Posted 2 years ago #

    worked a charm! Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic