Project

General

Profile

Actions

Bug #11464

closed

ERB trimming doesn't trim carriage returns

Added by Larivact (Martin Fischer) over 9 years ago. Updated over 7 years ago.

Status:
Closed
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
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0