ensl.org/config/initializers/bbcoder.rb
Luke Barratt b883b3de6c Improved forums layout
Made profile avatar proportional
Added header to sidebar widgets
Added bbcode colour support
2014-05-02 17:43:23 +01:00

32 lines
605 B
Ruby

BBCoder.configure do
tag :i, as: :em
tag :b, as: :strong
tag :sub, singular: true do
%(<sub>#{singular? ? meta : content}</sub>)
end
tag :sup, singular: true do
%(<sup>#{singular? ? meta : content}</sup>)
end
tag :ul
tag :ol
tag :li, parents: [:ol, :ul]
tag :size do
%(<span style="font-size: #{meta}px;">#{content}</span>)
end
tag :url do
if meta.nil? || meta.empty?
%(<a href="#{content}">#{content}</a>)
else
%(<a href="#{meta}">#{content}</a>)
end
end
tag :color do
%(<span style="color: #{meta};">#{content}</span>)
end
end