Sha256: 3241f32c7ecd6feb6c37d908fe37312d3ec3714b47b9b8fa0c08537c838e63ce

Contents?: true

Size: 340 Bytes

Versions: 1

Compression:

Stored size: 340 Bytes

Contents

unless defined?(RedCloth)
  gem 'RedCloth'
  require 'RedCloth'
end

module Snippets
  module Parsers
    class Textile
      def self.parse(text)
        textilized = RedCloth.new(text, [ :hard_breaks ])
        textilized.hard_breaks = true if textilized.respond_to?("hard_breaks=")
        textilized.to_html
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
djanowski-snippets-0.1.7 lib/snippets/parsers/textile.rb