Welcome to WebmasterWorld Guest from 54.163.35.238

Forum Moderators: phranque

Message Too Old, No Replies

Remove all whitespace between html tags

     

SlowMove

9:59 pm on Oct 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Aside from producing markup that's difficult to read, could there be any unexpected problems parsing html documents to exclude all spaces between ">" and "<"?

I haven't run the following code, but I think it would do it in Perl.
$html_text =~ s/(>)\s+(<)/$1$2/g;

SlowMove

10:05 pm on Oct 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What I'd really like to know is if there are cases where it would somehow make sense to have space between ">" and "<" characters

fourstardragon

1:14 am on Oct 8, 2004 (gmt 0)

10+ Year Member



"What I'd really like to know is if there are cases where it would somehow make sense to have space between ">" and "<" characters"
Not that I can think of offhand. It might affect JavaScript, but you can (and should) include that from a separate file.

encyclo

1:34 am on Oct 8, 2004 (gmt 0)

WebmasterWorld Senior Member encyclo is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I can't think of any particular problems, other than those if you have anything between
<pre></pre>
tags (which retains the formatting including the souse-code white space).

If you know the content of the pages and you're sure you haven't used

<pre></pre>
anywhere, I'd say go ahead - but keep a backup of the old stuff!
 

Featured Threads

Hot Threads This Week

Hot Threads This Month