Sha256: f58b1c264669c65e352796ff56377e172bbe1943fec97b618ee9618a575a4386

Contents?: true

Size: 436 Bytes

Versions: 9

Compression:

Stored size: 436 Bytes

Contents

module Publishr
  class KramdownProcessor
    def self.convert(html,image_url_prefix)
      sanitized_html = HtmlProcessor.sanitize(html)
      kramdown = Kramdown::Document.new(sanitized_html, :input => 'html', :line_width => 100000 ).to_kramdown
      kramdown.gsub!(/\!\[(.*?)\]\((.*?)\)/){ "![#{$1}](#{image_url_prefix}#{$2})" }
      kramdown.gsub! '\"', '"'
      kramdown.gsub! "\\'", "'"
      return kramdown
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
publishr-0.8.9 lib/publishr/kramdown_processor.rb
publishr-0.8.8 lib/publishr/kramdown_processor.rb
publishr-0.8.7 lib/publishr/kramdown_processor.rb
publishr-0.8.6 lib/publishr/kramdown_processor.rb
publishr-0.8.5 lib/publishr/kramdown_processor.rb
publishr-0.8.4 lib/publishr/kramdown_processor.rb
publishr-0.8.3 lib/publishr/kramdown_processor.rb
publishr-0.8.2 lib/publishr/kramdown_processor.rb
publishr-0.8.1 lib/publishr/kramdown_processor.rb