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 #1

Updated by nagachika (Tomoyuki Chikanaga) over 9 years ago

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

Updated by hsbt (Hiroshi SHIBATA) over 7 years ago

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

Updated by k0kubun (Takashi Kokubun) over 7 years ago

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

Updated by k0kubun (Takashi Kokubun) over 7 years ago

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

Updated by k0kubun (Takashi Kokubun) over 7 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]

Actions #6

Updated by nagachika (Tomoyuki Chikanaga) over 7 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 7 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 7 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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0