summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/erb.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/erb.rb b/lib/erb.rb
index 3cfbc11c30..9e68f5d70b 100644
--- a/lib/erb.rb
+++ b/lib/erb.rb
@@ -327,16 +327,18 @@ class ERB
end
def scan_line(line)
- line.scan(/(.*?)(<%%|%%>|<%=|<%#|<%|%>|\n|\z)/m) do |token|
- next if token.empty?
- yield(token)
+ line.scan(/(.*?)(<%%|%%>|<%=|<%#|<%|%>|\n|\z)/m) do |tokens|
+ tokens.each do |token|
+ next if token.empty?
+ yield(token)
+ end
end
end
def trim_line1(line)
line.scan(/(.*?)(<%%|%%>|<%=|<%#|<%|%>\n|%>|\n|\z)/m) do |tokens|
tokens.each do |token|
- next if token.empty?
+ next if token.empty?
if token == "%>\n"
yield('%>')
yield(:cr)