Project

General

Profile

Bug #11464

ERB trimming doesn't trim carriage returns

Added by Larivact (Martin Fischer) almost 5 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
[ruby-core:<unknown>]

Description

ERB trimming doesn't work if the .erb file was written on Windows (because Windows uses \r\n as line ending, whereas Linux uses only \n)
The implementation apparently only trims \n

ruby erbCarriageReturnBug.rb

Expected output:

<ul>
        <li>cucumber</li>
        <li>cucumber</li>
        <li>cucumber</li>
</ul>

Received output:

<ul>

        <li>cucumber</li>

        <li>cucumber</li>

        <li>cucumber</li>

</ul>

Corresponding documentation: http://ruby-doc.org/stdlib-2.2.2/libdoc/erb/rdoc/ERB.html


Files

example.erb (59 Bytes) example.erb Larivact (Martin Fischer), 08/19/2015 10:07 AM
erbCarriageReturnBug.rb (73 Bytes) erbCarriageReturnBug.rb Larivact (Martin Fischer), 08/19/2015 10:07 AM

Also available in: Atom PDF