winton / stasis

Static sites made powerful
http://stasis.me
MIT License
677 stars 56 forks source link

ERB with Windows EOL characters --> blank lines #37

Open ghost opened 12 years ago

ghost commented 12 years ago

Seen with Stasis 0.1.16 on Windows 7 64-Bit, Ruby 1.9.3-p0, latest Gem's as published at the time of report.

When using ERB layouts with Windows-style end-of-line (EOL) characters (i.e. CRLF) , the resulting output file has a double newline after each EOL. When using Unix-style or Mac-style EOL all is fine.

As an example, using an ERB template looking like this:

<!DOCTYPE html>
<html>
<head>
    <title>Test</title>
</head>
<body>
<%= yield %>
</body>
</html>

I get an output file looking like this:

<!DOCTYPE html>

<html>

<head>

    <title>Test</title>

</head>

<body>

<h1>Header 1</h1>
<p>This is a paragraph.</p>

</body>

</html>

The character sequence at the end of each output line is: CRCRLF