diff --git a/lib/micropub/post.rb b/lib/micropub/post.rb index 6e0b6f3..e141249 100644 --- a/lib/micropub/post.rb +++ b/lib/micropub/post.rb @@ -63,8 +63,10 @@ module Micropub params["content"]["text"] elsif params["content"]["html"] Kramdown::Document. - new(params["content"]["html"], html_to_native: true). - to_kramdown + new(params["content"]["html"], input: "html"). + to_kramdown. + gsub("\\", "") + # TODO: Look into possible Kramdown bug end end @@ -82,7 +84,7 @@ module Micropub #{post_frontmatter.strip} --- - #{content} + #{content.strip} POST end end diff --git a/test/lib/micropub/post_test.rb b/test/lib/micropub/post_test.rb index 8d8f8b4..f77e67f 100644 --- a/test/lib/micropub/post_test.rb +++ b/test/lib/micropub/post_test.rb @@ -170,11 +170,11 @@ describe Micropub::Post do _(post.content.strip).must_equal <<~MARKDOWN.strip This is a test post, with some lists and stuff. - > Well, the way they make shows is, they make one show. That show\\'s + > Well, the way they make shows is, they make one show. That show's > called a pilot. Then they show that show to the people who make shows, - > and on the strength of that one show they decide if they\\'re going to + > and on the strength of that one show they decide if they're going to > make more shows. Some pilots get picked and become television - > programs. Some don\\'t, become nothing. She starred in one of the ones + > programs. Some don't, become nothing. She starred in one of the ones > that became nothing. * One