=begin
Aside from compatibility with other implementations, what is harmed by making the suggested change? Would it break something that currently works? (I would expect that any legal ruby should be usable inside <%...%>, myself...)
=end
Assignee changed from seki (Masatoshi Seki) to k0kubun (Takashi Kokubun)
Supporting this kind of behavior doesn't make sense to me. Suppose following erb template:
foo <%# comment1 %> bar <%# comment2 %> baz
If such a feature is supported, I would expect this template to render "foo bar baz". But since " # comment1 " and " # comment2 " are embedded as Ruby script, concatenation for " bar ", " baz " and "\n" will be regarded as comment. And it's inevitable because we should keep erb's line numbers in generated code for correct backtrace.
In that situation, if we really want to support this, we need to trim comments when compiling erb by scanning all embedded Ruby scripts using Ripper or something. I don't think it's a consistent behavior considering embedded scripts are originally evaluated only on rendering. And it will have performance regression for compiling time. So the most reasonable way to achieve such single-line comment is just using "<%#".