Project

General

Profile

Actions

Bug #14243

closed

Comments inside ERB tags broken

Added by jsc (Justin Collins) over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]
[ruby-core:84484]

Description

A backwards-incompatible change was introduced with https://github.com/ruby/ruby/commit/abbfc048c5890e8017360bbc845062ea1585e155#diff-e1ea8366d3ac334deab7e0d25309be03

Example:

require "erb"
input = "<% # comment %>\n"
puts ERB.new(input).src

Before:

#coding:UTF-8
_erbout = +'';  # comment ; _erbout.<< -"\n"
; _erbout

After:

#coding:UTF-8
_erbout = +'';  # comment ; _erbout.<<(-"\n"
); _erbout

The generated code produces a syntax error due to introduction of parentheses around the arguments.


Files

erb_test.rb (71 Bytes) erb_test.rb Example script jsc (Justin Collins), 12/26/2017 07:34 PM

Related issues 1 (0 open1 closed)

Is duplicate of Ruby master - Bug #1868: ERB single line comment does not workRejectedk0kubun (Takashi Kokubun)Actions
Actions

Also available in: Atom PDF