use safe markdown for comments to prevent xss
authorIan Kelling <ian@iankelling.org>
Wed, 28 Sep 2016 07:30:59 +0000 (00:30 -0700)
committerIan Kelling <ian@iankelling.org>
Wed, 28 Sep 2016 07:30:59 +0000 (00:30 -0700)
b.rb

diff --git a/b.rb b/b.rb
index 432bbc2..b5e2aa9 100644 (file)
--- a/b.rb
+++ b/b.rb
@@ -126,7 +126,7 @@ EOF
   end
 
   def comment_html(comment, date)
-    inner = Redcarpet::Markdown.new(Redcarpet::Render::HTML, fenced_code_blocks: true).render(<<EOF)
+    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