def find_and_preserve(input = nil, tags = haml_buffer.options[:preserve], &block)
      return find_and_preserve(capture_haml(&block), input || tags) if block
      tags = tags.map { |tag| Regexp.escape(tag) }.join('|')
      re = /<(#{tags})([^>]*)>(.*?)(<\/\1>)/im
      input.to_s.gsub(re) do |s|
        s =~ re # Can't rely on $1, etc. existing since Rails' SafeBuffer#gsub is incompatible
        "<#{$1}#{$2}>#{preserve($3)}</#{$1}>"
      end
    end
def find_and_preserve(input = nil, tags = haml_buffer.options[:preserve], &block)
      return find_and_preserve(capture_haml(&block), input || tags) if block
      tags = tags.map { |tag| Regexp.escape(tag) }.join('|')
      re = /<(#{tags})([^>]*)>(.*?)(<\/\1>)/im
      input.to_s.gsub(re) do |s|
        s =~ re # Can't rely on $1, etc. existing since Rails' SafeBuffer#gsub is incompatible
        "<#{$1}#{$2}>#{preserve($3)}</#{$1}>"
      end
    end
Uses \{#preserve} to convert any newlines inside whitespace-sensitive tags
 into the HTML entities for endlines.

 @param tags [Array<String>] Tags that should have newlines escaped

 @overload find_and_preserve(input, tags = haml_buffer.options[:preserve])
   Escapes newlines within a string.

   @param input [String] The string within which to escape newlines
 @overload find_and_preserve(tags = haml_buffer.options[:preserve])
   Escapes newlines within a block of Haml code.

   @yield The block within which to escape newlines