https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112015-10-28T00:49:03ZRuby Issue Tracking SystemRuby master - Feature #11624: ERB deserves its own commenting tokenhttps://redmine.ruby-lang.org/issues/11624?journal_id=546112015-10-28T00:49:03Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/54611/diff?detail_id=39193">diff</a>)</li><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>seki (Masatoshi Seki)</i></li></ul> Ruby master - Feature #11624: ERB deserves its own commenting tokenhttps://redmine.ruby-lang.org/issues/11624?journal_id=648412017-05-16T01:23:37Zhsbt (Hiroshi SHIBATA)hsbt@ruby-lang.org
<ul><li><strong>Assignee</strong> changed from <i>seki (Masatoshi Seki)</i> to <i>k0kubun (Takashi Kokubun)</i></li><li><strong>Target version</strong> set to <i>2.5</i></li></ul> Ruby master - Feature #11624: ERB deserves its own commenting tokenhttps://redmine.ruby-lang.org/issues/11624?journal_id=650892017-05-25T14:08:01Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Rejected</i></li></ul><p>This syntax only adds a support for comments that include "%>" or "%%>". I think the major use case of such kind of feature is just ad-hoc disabling partial template and it's not for a normal permanent comment, which can be done in "<%#". So I think its use case is limited compared to "<%#"'s one.</p>
<p>The downside of this feature is slowing down compilation. It will be reported as a bug like [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: [PERF] bm_app_erb.rb slower (Closed)" href="https://redmine.ruby-lang.org/issues/12074">#12074</a>].</p>
<p>Comparing merits and demerits, for now, I reject this feature in ERB and solve your problem with third-party library <a href="https://github.com/k0kubun/erb-comment" class="external">https://github.com/k0kubun/erb-comment</a>.</p>
<p>If you want to use it on Rails, you may need to port this to Erubi. If main use case is web application (it's not the case for ERB), it's less important to care about compilation cost. So it'll be a good idea to have such a feature in Erubi.</p>