Unwanted empty lines in the resulting HTML files


#1

Hey all,

I got a weird issue where my Ruby tags looking like this:
<% (something) -%>
actually produces empty lines once I put them on my webhost. Locally
while I develop I don’t get them at all. This is really annoying as
the resulting HTML code looks really messed up.

I have frozen Rails, so it’s the exact same Rails code being run
locally as well as in production. What might cause this problem? Known
bug? Is there any other way to stop if statements and ends to create
blank lines?

Thanks,
Mathias.


#2

Mathias W. wrote:

Hey all,

I got a weird issue where my Ruby tags looking like this:
<% (something) -%>
actually produces empty lines once I put them on my webhost. Locally
while I develop I don’t get them at all. This is really annoying as
the resulting HTML code looks really messed up.

I have frozen Rails, so it’s the exact same Rails code being run
locally as well as in production. What might cause this problem? Known
bug? Is there any other way to stop if statements and ends to create
blank lines?

Thanks,
Mathias.

Try %> instead of -%>

Abon


#3

On 1/27/07, Bontina C. removed_email_address@domain.invalid wrote:

Try %> instead of -%>

Abon

I thought the dash would force that line to not produce any blank
lines. Isn’t that the feature? I guess I’ll try without it, can’t
hurt. :slight_smile:

Thanks,
Mathias.


#4

On 1/27/07, Bontina C. removed_email_address@domain.invalid wrote:

Try %> instead of -%>

Abon

Just tried this and it made no difference.

I’m developing the project under Windows (in RadRails) and it is
deployed to a Linux server. Could it be some end-of-line delimiter
that’s different between the OSes that’s causing this bug? I can’t be
the only one suffering from this?

Mathias.


#5

On 1/27/07, Russell N. removed_email_address@domain.invalid wrote:

Yeah. I used to have this problem. I think it’s definitely an issue with
Windows line-endings. I solved it by [ack] editing the files on the server
[with pico/nano]. Now I develop on Linux so there’s no issue. I don’t think.

RSL

I looked into this a bit more and it seems like one problem is that if
you comment out the line, for example:
<% # if whatever? -%>
then it will still produce an empty line. But there were other places
where the problems disappeared once I started editing the files on the
server to try it out. So it might be a combination. Will keep it in
mind though, will help me with the trouble shooting if it happens
again.

Thanks,
Mathias.


#6

Yeah. I used to have this problem. I think it’s definitely an issue with
Windows line-endings. I solved it by [ack] editing the files on the
server
[with pico/nano]. Now I develop on Linux so there’s no issue. I don’t
think.

RSL