require 'bbcoder/base' require 'bbcoder/configuration' require 'bbcoder/tag' require 'bbcoder/buffer' require 'bbcoder/buffer_tags' require 'bbcoder/string' BBCoder.configure do tag :p tag :b, :as => :strong tag :i, :as => :em tag :u tag :s, :as => :strike tag :del tag :ins tag :ol tag :ul tag :li, :parents => [:ol, :ul] tag :dl tag :dt, :parents => [:dl] tag :dd, :parents => [:dl] tag :quote do quoted = meta.empty? ? '' : "\n " <<-EOS
EOS end tag :code do <<-EOS EOS end tag :spoiler do <<-EOS EOS end tag :url, :match_link => /^https?:\/\// do if meta.nil? || meta.empty? %(#{content}) else %(#{content}) end end tag :img, :match => /^https?:\/\/.*(png|bmp|jpe?g|gif)$/, :singular => true do %() end tag :youtube do <<-EOS EOS end tag :sub, :singular => true do %(#{singular? ? meta : content}) end tag :sup, :singular => true do %(#{singular? ? meta : content}) end end