method
explicit_trim_line
v2_5_5 -
Show latest stable
- Class:
ERB::Compiler::TrimScanner
explicit_trim_line(line)public
No documentation available.
# File lib/erb.rb, line 473
def explicit_trim_line(line)
line.scan(@scan_reg) do |tokens|
tokens.each do |token|
next if token.empty?
if @stag.nil? && /[ \t]*<%-/ =~ token
yield('<%')
elsif @stag && (token == "-%>\n" || token == "-%>\r\n")
yield('%>')
yield(:cr)
elsif @stag && token == '-%>'
yield('%>')
else
yield(token)
end
end
end
end