require 'uv' class CodeMacro < FilteredColumn::Macros::Base def self.filter(attributes, inner_text = '', text = '') lang = attributes.delete(:lang) || "ruby_on_rails" theme = attributes.delete(:theme) || "blackboard" begin Uv.parse( inner_text, "xhtml", lang, false, theme) rescue RAILS_DEFAULT_LOGGER.warn "UltraViolet Error: #{$!.message}" RAILS_DEFAULT_LOGGER.debug $!.backtrace.join("\n") end end end