Project

General

Profile

Bug #11464

ERB trimming doesn't trim carriage returns

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

Associated revisions

Revision 040f2756
Added by k0kubun (Takashi Kokubun) almost 2 years ago

erb.rb: Allow trimming carriage return

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

[Bug #11464]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 58823
Added by k0kubun (Takashi Kokubun) almost 2 years ago

erb.rb: Allow trimming carriage return

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

[Bug #11464]

Revision 58823
Added by k0kubun (Takashi Kokubun) almost 2 years ago

erb.rb: Allow trimming carriage return

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

[Bug #11464]

Revision 58823
Added by k0kubun (Takashi Kokubun) almost 2 years ago

erb.rb: Allow trimming carriage return

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

[Bug #11464]

Revision 2d909334
Added by usa (Usaku NAKAMURA) over 1 year ago

merge revision(s) 58823: [Backport #11464]

erb.rb: Allow trimming carriage return

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

[Bug #11464]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@59225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 59225
Added by usa (Usaku NAKAMURA) over 1 year ago

merge revision(s) 58823: [Backport #11464]

erb.rb: Allow trimming carriage return

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

[Bug #11464]

Revision 05215d0d
Added by nagachika (Tomoyuki Chikanaga) over 1 year ago

merge revision(s) 58823: [Backport #11464]

erb.rb: Allow trimming carriage return

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

[Bug #11464]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 59300
Added by nagachika (Tomoyuki Chikanaga) over 1 year ago

merge revision(s) 58823: [Backport #11464]

erb.rb: Allow trimming carriage return

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

[Bug #11464]

History

#1

Updated by nagachika (Tomoyuki Chikanaga) over 3 years ago

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

Updated by hsbt (Hiroshi SHIBATA) almost 2 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 2 years ago

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

Updated by k0kubun (Takashi Kokubun) almost 2 years ago

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

Updated by k0kubun (Takashi Kokubun) almost 2 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 2 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 1 year 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 1 year 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