This project is archived and is in readonly mode.

#3163 ✓invalid
DavidT

Comments in erb/rthml cause incorrect formatting

Reported by DavidT | September 8th, 2009 @ 04:34 AM

Comments in rhtml/erb code can cause the parser to behave incorrectly.

For example:

  <% if true #comment %>
    <li><%= link_to "Announcements", :controller => "announcement", :action => "list" %></li>
  <% end -%>

  <li><%= link_to "Realview", :controller => "realview", :action => "refresh" %></li>

  <li><%= link_to "System Configuration", :controller => "system", :action => "configure" %></li>

Yields:

  <a href="/announcement/list">Announcements</a></li>    <----ERROR LINE

  <li><a href="/realview/refresh">Realview</a></li>

  <li><a href="/system/configure">System Configuration</a></li>

Note that the "

  • " is missing from the beginning of "ERROR LINE".

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages