method

add_text

Importance_0
v7.0.0 - Show latest stable - 0 notes - Class: Erubi
add_text(text) private

No documentation

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

Hide source
# File actionview/lib/action_view/template/handlers/erb/erubi.rb, line 36
          def add_text(text)
            return if text.empty?

            if text == "\n"
              @newline_pending += 1
            else
              src << bufvar << ".safe_append='"
              src << "\n" * @newline_pending if @newline_pending > 0
              src << text.gsub(/['\\]/, '\\\&')
              src << "'.freeze;"

              @newline_pending = 0
            end
          end
Register or log in to add new notes.