diff --git a/lib/awestruct/textilable.rb b/lib/awestruct/textilable.rb index a5638a08..a3d3ab8b 100644 --- a/lib/awestruct/textilable.rb +++ b/lib/awestruct/textilable.rb @@ -4,7 +4,11 @@ module Textilable def render(context) rendered = '' begin - rendered = RedCloth.new( context.interpolate_string( raw_page_content ) ).to_html + # a module of rule functions is included in RedCloth using RedCloth.send(:include, MyRules) + # rule functions on that module are activated by setting the property site.textile_rules + # ex. site.textile_rules = ['emoticons'] + rules = context.site.textile_rules ? context.site.textile_rules.map { |r| r.to_sym } : [] + rendered = RedCloth.new( context.interpolate_string( raw_page_content ) ).to_html(*rules) rescue => e puts e puts e.backtrace