class Opal::ERB::Compiler

def find_contents(result)

def find_contents(result)
  result.gsub(/<%=([\s\S]+?)%>/) do
    inner = Regexp.last_match(1).gsub(/\\'/, "'").gsub(/\\"/, '"')
    if inner =~ BLOCK_EXPR
      "\")\noutput_buffer.append= #{inner}\noutput_buffer.append(\""
    else
      "\")\noutput_buffer.append=(#{inner})\noutput_buffer.append(\""
    end
  end
end