homepage Welcome to WebmasterWorld Guest from 184.73.104.82
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library, Charter, Moderators: phranque

Webmaster General Forum

    
Remove all whitespace between html tags
SlowMove

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 6806 posted 9:59 pm on Oct 7, 2004 (gmt 0)

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

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 6806 posted 10:05 pm on Oct 7, 2004 (gmt 0)

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

10+ Year Member



 
Msg#: 6806 posted 1:14 am on Oct 8, 2004 (gmt 0)

"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

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



 
Msg#: 6806 posted 1:34 am on Oct 8, 2004 (gmt 0)

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!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Webmaster General
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved