method
trim_line2
trim_line2(line)
public
Hide source
# File lib/erb.rb, line 370 def trim_line2(line) head = nil line.scan(/(.*?)(<%%|%%>|<%=|<%#|<%|%>\n|%>|\n|\z)/) do |tokens| tokens.each do |token| next if token.empty? head = token unless head if token == "%>\n" yield('%>') if is_erb_stag?(head) yield(:cr) else yield("\n") end head = nil else yield(token) head = nil if token == "\n" end end end end