Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a format option for converting posts to markdown via Python's htm…

…l2text.
  • Loading branch information...
commit b762a1d5c5b10b307df9a7c879f5f1540d21cf96 1 parent 8731689
@stephenmcd authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/jekyll/migrators/tumblr.rb
View
3  lib/jekyll/migrators/tumblr.rb
@@ -8,7 +8,7 @@
module Jekyll
module Tumblr
- def self.process(url, grab_images = false)
+ def self.process(url, grab_images = false, format = "html")
current_page = 0
while true
@@ -75,6 +75,7 @@ def self.process(url, grab_images = false)
name = "#{Date.parse(post['date']).to_s}-#{title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')}.#{format}"
if title != nil || content != nil && name != nil
+ content = %x[echo '#{content.gsub("'", "''")}' | html2text] if format == "md"
File.open("_posts/tumblr/#{name}", "w") do |f|
f.puts <<-HEADER
Please sign in to comment.
Something went wrong with that request. Please try again.