Skip to content

Commit

Permalink
regexp for image filter should be case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
dejan committed Apr 19, 2009
1 parent d36c8d7 commit 9153f16
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/auto_html/filters/image.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AutoHtml.add_filter(:image) do |text|
text.gsub(/http:\/\/.+\.(jpg|gif|png)/) do |match|
text.gsub(/http:\/\/.+\.(jpg|gif|png)/i) do |match|
%|<img src="#{match}" alt=""/>|
end
end
4 changes: 4 additions & 0 deletions spec/filters/image_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@

auto_html('http://blog.phusion.nl/2009/04/16/phusions-one-year-anniversary-gift-phusion-passenger-220/') { image }.should_not ==
'<img src="http://blog.phusion.nl/2009/04/16/phusions-one-year-anniversary-gif" alt=""/>'

auto_html('http://www.lockhartfineart.com/images/Rio_Grande_Frost.JPG') { image }.should ==
'<img src="http://www.lockhartfineart.com/images/Rio_Grande_Frost.JPG" alt=""/>'

end
end

0 comments on commit 9153f16

Please sign in to comment.