Sha256: e634baee965aa724f7c6e652253037e82730fa1ebf74e70773b4a18e082b8b70

Contents?: true

Size: 810 Bytes

Versions: 6

Compression:

Stored size: 810 Bytes

Contents

module ActionView::Template::Handlers
  class Textile
    class_attribute :default_format
    self.default_format = Mime[:html]

    def erb_handler
      @@erb_handler ||= ActionView::Template.registered_template_handler(:erb)
    end

    # def call(template, source)
    #   compiled_source = erb_handler.call(template, source)
    #   "RedCloth.new(begin;#{compiled_source};end).to_html.html_safe"
    # end
    if Rails.version < '6.0.0.beta2'
      def call(template)
        compiled_source = erb_handler.call(template)
        "RedCloth.new(begin;#{compiled_source};end).to_html.html_safe"
      end
    else
      def call(template, source)
        compiled_source = erb_handler.call(template, source)
        "RedCloth.new(begin;#{compiled_source};end).to_html.html_safe"
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cmor_cms-0.0.6.pre app/template_handlers/action_view/template/handlers/textile.rb
cmor_cms-0.0.5.pre app/template_handlers/action_view/template/handlers/textile.rb
cmor_cms-0.0.4.pre app/template_handlers/action_view/template/handlers/textile.rb
cmor_cms-0.0.3.pre app/template_handlers/action_view/template/handlers/textile.rb
cmor_cms-0.0.2.pre app/template_handlers/action_view/template/handlers/textile.rb
cmor_cms-0.0.1.pre app/template_handlers/action_view/template/handlers/textile.rb