This project is archived and is in readonly mode.
Comments in erb/rthml cause incorrect formatting
-
CancelProfileIsBroken
- State changed from new to invalid
1) Putting # in the middle of an ERB code chunk to indicate a comment isn't supported by ERB. It used to work by accident under Ruby 1.8.6, but that's an implementation detail that changed in 1.8.7. The valid syntax for ERB comments is
<%# comment -- ignored -- useful in testing %>see http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html and http://www.ruby-forum.com/topic/154835
2) If you want to propose a change in ERB itself, you need to go upstream; Rails is just an ERB consumer.
-
Ian Moss
I get the feeling this SHOULD be possible in Rails.
In Ruby a comment is a #
In Rails Erb I start a Ruby block of code with <% and finish it with %>
To me, it seems logical that anything following a # should work as a ruby comment.
It shouldn't matter if there is whitespace before or not.Can someone point me towards the bit of rails core code that deals with comments, so I can fix this or branch or whatever is needed.
I'm going to go off and search the rails git code base now - but am thinking someone may well read this before I find it.
Thanks - Ian - http://twitter.com/oceanician
-
CancelProfileIsBroken
Again, this isn't in Rails. ERB is responsible for handling those blocks. Once we hit the <% we're out of the Rails codebase.
-
Ian Moss
Great - I'm new to the Rails codebase, whereabouts is the ERB code?
I've tried to search via GitHub but can't find it.
Is their a contributors readme someplace I should be looking at ?
Cheers,
Ian.
http://twitter.com/oceanician -
Ian Moss
Aha - Ok so it helps understanding the R is Ruby not Rails for me :)
Found the erb within ruby:
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/lib/erb.rb?view=log1Ian
-
Ryan Bigg
Automatic cleanup of spam.
-
Ryan Bigg
Automatic cleanup of spam.