Help - Search - Members - Calendar
Full Version: Remove extra carriage returns (newlines) from HTML
Movable Type Community Forum > Additional Resources > Tips and Tricks
allierogers
How does one remove extra carriage returns (newlines) from HTML generated by MT?

When I "View Source" for my weblog index or archive page, it appears MT has inserted 2 carriage returns between every line of HTML.  This is true for both the HTML that comes directly from the templates, as well as the "dynamic" HTML generated from the weblog post itself, and other MT tags.  The templates, themselves, do not have extra newlines.

The only place where this is NOT true is the Trackback XML, which has no extra newlines.  Curiously, examining the MT Perl code reveals that the Trackback XML is just about the only bit that is "hard coded" with print statements of its own.  The rest is generated by processing templates and weblog entry data.  

Something, somewhere is adding extra newlines and I would like to get rid of them.  This is especially annoying when I post a new entry that includes some "pre"-like tags.

The extra newlines are NOT the same thing as the "Convert line breaks" option.  These extra newlines occur regardless of the setting of this option.

I am running ActiveState Perl 5.6.1-633 on a Windows 2000/IIS 5 server.

Thanks.

MORE INFO...

Closer examination of the source HTML files (created by MT) as they actually exist on the server indicate there are NO extra newlines.  Perhaps this is an HTML encoding issue.  What is the proper HTML DOCTYPE and/or meta tag charset to use for U.S. English?
bmk
see if this thread helps you
allierogers
Thanks it does, but there is more to my issue.

It turns out that IE6 is adding the newlines when I "View Source".  The actual source does not have extra newlines.

I thought it did because my "pre" posts did not look right.  THAT bug turned out to be my poor CSS code.  I fixed the line-height.  It was 140% (inherited from .blog_body or .blog class, I think).  I set it to 90% and all is well.

Thank you very much!
kadyellebee
Ahh, I wouldn't have thought of that -- that IE6 was changing it!  Thanks for coming back and sharing what the issue was smile.gif

Kristine
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.