Sha256: 73ae1c63f5450f57c6aa53500448085f9d5945757c8f316692f7c745566fb475

Contents?: true

Size: 732 Bytes

Versions: 2

Compression:

Stored size: 732 Bytes

Contents

module Octopress
  module Tags
    module Quote
      module Utils
        def self.parse_content(content, context)
          path  = context.environments.first['page']['path']
          ext   = File.extname(path[1..-1])[1..-1]
          site  = context.registers[:site]
          mdext = site.config['markdown_ext']
          txext = site.config['textile_ext']

          if mdext.include? ext
            site.getConverterImpl(Jekyll::Converters::Markdown).convert(content)
          elsif txext.include? ext
            site.getConverterImpl(Jekyll::Converters::Textile).convert(content)
          else
            "<p>" + content.strip.gsub(/\n\n/, "<p>\n\n</p>") + "</p>"
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
octopress-quote-tag-1.0.4 lib/octopress-quote-tag/utils.rb
octopress-quote-tag-1.0.3 lib/octopress-quote-tag/utils.rb