method
trim_line2
trim_line2(line)
public
Hide source
# File lib/erb.rb, line 453 def trim_line2(line) head = nil line.scan(@scan_reg) do |tokens| tokens.each do |token| next if token.empty? head = token unless head if token == "%>\n" || token == "%>\r\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