Flowdock
trim_line2(line) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/erb.rb, line 440
      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
Register or log in to add new notes.