lib/bbcoder.rb in bbcoder-1.0.0 vs lib/bbcoder.rb in bbcoder-1.0.1
- old
+ new
@@ -19,13 +19,14 @@
tag :dl
tag :dt, :parents => [:dl]
tag :dd, :parents => [:dl]
tag :quote do
+ quoted = meta.empty? ? '' : "\n <legend>#{meta} says</legend>"
+
<<-EOS
-<fieldset>
-<legend>#{meta} says</legend>
+<fieldset>#{quoted}
<blockquote>
#{content}
</blockquote>
</fieldset>
EOS
@@ -46,18 +47,18 @@
<div>#{content}</div>
</fieldset>
EOS
end
- tag :url do
+ tag :url, :match_link => /^https?:\/\// do
if meta.nil? || meta.empty?
%(<a href="#{content}">#{content}</a>)
else
%(<a href="#{meta}">#{content}</a>)
end
end
- tag :img, :match => /^.*(png|bmp|jpe?g|gif)$/, :singular => true do
+ tag :img, :match => /^https?:\/\/.*(png|bmp|jpe?g|gif)$/, :singular => true do
%(<a href="#{singular? ? meta : content}"><img src="#{singular? ? meta : content}" /></a>)
end
tag :youtube do
<<-EOS