Issue #213 has been reported by Federico Builes.

----------------------------------------
Bug #213: Different ERB behavior across versions
http://redmine.ruby-lang.org/issues/show/213

Author: Federico Builes
Status: Open
Priority: Normal
Assigned to: 
Category: 
Target version: 


I'm seeing some differences in ERB processing across 1.8.6, 1.8.7 and
1.9. 1.8.6 and 1.9 behave the same while 1.8.7 differs:

     $ cat foo.rb 
     require 'erb'
     str = <<'END'
     <ul>
     % list = [1,2,3]
     %for item in list
     %  if item
       <li><%= item %>
       <% end %>
     <% end %>
     </ul>
     %%%
     END
     
     p ERB.new(str, nil, "%").result
     
     
     $ ruby -v foo.rb 
     ruby 1.8.6 (2008-06-29 patchlevel 255) [i686-darwin9.3.0]
     "<ul>\n  <li>1\n  \n  <li>2\n  \n  <li>3\n  \n\n</ul>\n%%\n"
     
     $ ruby-1.9 -v foo.rb 
     ruby 1.9.0 (2008-06-10 revision 15929) [i686-darwin9.3.0]
     "<ul>\n  <li>1\n  \n  <li>2\n  \n  <li>3\n  \n\n</ul>\n%%\n"
     
     $ ruby-1.8.7 -v foo.rb 
     ruby 1.8.7 (2008-05-31 patchlevel 0) [i686-darwin9.3.0]
     "<ul>\n  <li>1\n  \n  <li>2\n  \n  <li>3\n  \n\n</ul>\n%"
     
In order:
     
     # 1.8.6 => "<ul>\n  <li>1\n  \n  <li>2\n  \n  <li>3\n  \n\n</ul>\n%%\n"
     # 1.9   => "<ul>\n  <li>1\n  \n  <li>2\n  \n  <li>3\n  \n\n</ul>\n%%\n"
     # 1.8.7 => "<ul>\n  <li>1\n  \n  <li>2\n  \n  <li>3\n  \n\n</ul>\n%"

I think this is a bug in 1.8.7 but I'd like some clarification.


----------------------------------------
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://redmine.ruby-lang.org/my/account