lib/bbcoder.rb in bbcoder-0.2.0 vs lib/bbcoder.rb in bbcoder-1.0.0
- old
+ new
@@ -54,11 +54,11 @@
else
%(<a href="#{meta}">#{content}</a>)
end
end
- tag :img, :match => /^.*(png|bmp|jpg|gif)$/ do
- %(<a href="#{content}"><img src="#{content}" /></a>)
+ tag :img, :match => /^.*(png|bmp|jpe?g|gif)$/, :singular => true do
+ %(<a href="#{singular? ? meta : content}"><img src="#{singular? ? meta : content}" /></a>)
end
tag :youtube do
<<-EOS
<iframe width="560" height="349" src="http://www.youtube.com/embed/#{content}" frameborder="0" allowfullscreen></iframe>