fix comment formatting regression from safe markup
[iankelling.org] / b.rb
diff --git a/b.rb b/b.rb
index 2dc8ad8ad7d9287dda1106a67b66544642663cd0..c2dbc75bae6ff6f8b5839941f083e7ef19e49563 100644 (file)
--- a/b.rb
+++ b/b.rb
@@ -125,15 +125,14 @@ EOF
   end
 
   def comment_html(comment, date)
-    inner = Redcarpet::Markdown.new(Redcarpet::Render::Safe, fenced_code_blocks: true).render(<<EOF)
-#{comment}
-<span class="comment-date">#{Time.at(date).strftime("%b %-d '%y")}</span>
-EOF
     # I tried putting the time,  %I:%M %p UTC, but it looks kinda
     # clunky, going against my simple theme.
+    user_input = Redcarpet::Markdown.new(Redcarpet::Render::Safe,
+                                   fenced_code_blocks: true).render(comment)
     <<EOF
 <div class="comment">
-  #{inner}
+  #{user_input}
+  <p class="comment-date">#{Time.at(date).strftime("%b %-d '%y")}</p>
 </div>
 EOF
   end