method

add_text

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 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 30
          def add_text(text)
            return if text.empty?

            if text == "\n"
              @newline_pending += 1
            else
              with_buffer do
                src << ".safe_append='"
                src << "\n" * @newline_pending if @newline_pending > 0
                src << text.gsub(/['\\]/, '\\\&') << @text_end
              end
              @newline_pending = 0
            end
          end
Register or log in to add new notes.