FIX: correct excerpts not parsing markdown correctly

FIX: correct excerpts not parsing markdown correctly

Depends on 69aa8f18

diff --git a/lib/discourse_code_review/importer.rb b/lib/discourse_code_review/importer.rb
index 85b30af..6cea87f 100644
--- a/lib/discourse_code_review/importer.rb
+++ b/lib/discourse_code_review/importer.rb
@@ -95,7 +95,7 @@ module DiscourseCodeReview
 
       short_hash = "<small>sha: #{commit[:hash][0...8]}</small>"
 
-      raw = "<div class='excerpt'>\n#{body}\n</div>\n\n`‍``diff\n#{diff}\n#{truncated_message}`‍``\n#{link} #{short_hash}"
+      raw = "[excerpt]\n#{body}\n[/excerpt]\n\n`‍``diff\n#{diff}\n#{truncated_message}`‍``\n#{link} #{short_hash}"
 
       user = ensure_user(
         email: commit[:email],
diff --git a/spec/discourse_code_review/lib/importer_spec.rb b/spec/discourse_code_review/lib/importer_spec.rb
index eec13ec..f83ebd1 100644
--- a/spec/discourse_code_review/lib/importer_spec.rb
+++ b/spec/discourse_code_review/lib/importer_spec.rb
@@ -65,26 +65,31 @@ module DiscourseCodeReview
 
     end
 
-    it "can escape diff `‍``" do
+    it "can handle complex imports" do
 
       repo = GithubRepo.new("discourse/discourse", Octokit::Client.new)
 
       diff = "`‍``\nwith a diff"
 
+      body = <<~MD
+      this is [amazing](http://amaz.ing)
+      MD
+
       commit = {
         subject: "hello world",
-        body: "this is the body",
+        body: body,
         email: "sam@sam.com",
         github_login: "sam",
         github_id: "111",
         date: 1.day.ago,
-        diff: diff
+        diff: diff,
+        hash: SecureRandom.hex
       }
 
       post = Importer.new(repo).import_commit(commit)
 
       expect(post.cooked.scan("code").length).to eq(2)
-      expect(post.excerpt).to eq("this is the body")
+      expect(post.excerpt).to eq("this is <a href=\"http://amaz.ing\">amazing</a>")
     end
   end
 end

GitHub
sha: faf1528d