<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -352,7 +352,7 @@ class OEmbed
         txt.gsub!(u, response.to_s)
       else
         yield(response, u)
-        txt.gsub!(u, response.rendered_content)
+        (response.has_rendered?) ? txt.gsub!(u, response.rendered_content) : txt
       end
     else
       if block.nil?
@@ -360,7 +360,7 @@ class OEmbed
       else
         response = OEmbed::Response.new(&quot;&quot;, u, {})
         yield(response, u)
-        txt.gsub!(u, response.rendered_content)
+        (response.has_rendered?) ? txt.gsub!(u, response.rendered_content) : txt
       end      
     end
   end</diff>
      <filename>lib/oembed_links.rb</filename>
    </modified>
    <modified>
      <diff>@@ -80,6 +80,10 @@ class OEmbed
       end
     end
 
+    def has_rendered?
+      !@rendered.nil?
+    end    
+
     private
 
     # Needlessly stupid priority for rendering.
@@ -95,9 +99,6 @@ class OEmbed
       end
     end
 
-    def has_rendered?
-      !@rendered.nil?
-    end
     
     def render_content(*args, &amp;block)
       options = (args.last.is_a?(Hash)) ? args.last : { }</diff>
      <filename>lib/oembed_links/response.rb</filename>
    </modified>
    <modified>
      <diff>@@ -166,7 +166,13 @@ describe OEmbed, &quot;transforming functions&quot; do
       r.hedgehog? { |v| &quot;hedgey&quot;}
       r.from?(:test2) { |t| &quot;test2&quot; }
       r.matches?(/baz/) { |m| &quot;regex&quot; }
-    end.should == &quot;foo&quot; 
+    end.should == &quot;http://test1.net/foo&quot; 
+  end
+
+  it &quot;should transform only urls which have registered providers&quot; do
+    OEmbed.transform(&quot;http://test1.net/foo and http://not.a.valid.url.host/fake are urls&quot;) do |r, url|
+      r.video? { |v| &quot;video&quot; }
+    end.should == &quot;video and http://not.a.valid.url.host/fake are urls&quot;    
   end
 
   it &quot;should pass control to the .none? block if no scheme matched&quot; do</diff>
      <filename>spec/oembed_links_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>fc55499f97e90ca23fcecf706040df4cec969eb7</id>
    </parent>
  </parents>
  <author>
    <name>netshade</name>
    <email>netshade@gmail.com</email>
  </author>
  <url>http://github.com/netshade/oembed_links/commit/924be813e7ab499f81cb2306e8721da8f1bcc56c</url>
  <id>924be813e7ab499f81cb2306e8721da8f1bcc56c</id>
  <committed-date>2009-06-09T07:07:50-07:00</committed-date>
  <authored-date>2009-06-09T07:07:50-07:00</authored-date>
  <message>fix bad transform attempt when rendered content is nil:</message>
  <tree>0153c0138d6e439b37d3b51f01c2038a72a4d732</tree>
  <committer>
    <name>netshade</name>
    <email>netshade@gmail.com</email>
  </committer>
</commit>
