Project

General

Profile

Bug #11464

ERB trimming doesn't trim carriage returns

Added by Larivact (Martin Fischer) over 4 years ago. Updated over 2 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
#1

Updated by nagachika (Tomoyuki Chikanaga) over 4 years ago

  • Status changed from Open to Assigned
  • Assignee set to seki (Masatoshi Seki)

Updated by hsbt (Hiroshi SHIBATA) almost 3 years ago

  • Target version set to 2.5
  • Assignee changed from seki (Masatoshi Seki) to k0kubun (Takashi Kokubun)
#3

Updated by k0kubun (Takashi Kokubun) almost 3 years ago

  • Has duplicate Bug #5339: ERB generates extra newlines on Windows added
#4

Updated by k0kubun (Takashi Kokubun) almost 3 years ago

  • Has duplicate deleted (Bug #5339: ERB generates extra newlines on Windows)
#5

Updated by k0kubun (Takashi Kokubun) almost 3 years ago

  • Status changed from Assigned to Closed

Applied in changeset trunk|r58823.


erb.rb: Allow trimming carriage return

when trim_mode is "<>", for Windows environments.

[Bug #11464]

#6

Updated by nagachika (Tomoyuki Chikanaga) almost 3 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.2: REQUIRED, 2.3: REQUIRED, 2.4: REQUIRED

Updated by usa (Usaku NAKAMURA) over 2 years ago

  • Backport changed from 2.2: REQUIRED, 2.3: REQUIRED, 2.4: REQUIRED to 2.2: REQUIRED, 2.3: DONE, 2.4: REQUIRED

ruby_2_3 r59225 merged revision(s) 58823.

Updated by nagachika (Tomoyuki Chikanaga) over 2 years ago

  • Backport changed from 2.2: REQUIRED, 2.3: DONE, 2.4: REQUIRED to 2.2: REQUIRED, 2.3: DONE, 2.4: DONE

ruby_2_4 r59300 merged revision(s) 58823.

Also available in: Atom PDF