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
comment_html("Note: there #{text} pending approval.", NOW)
end
com_section = <<-EOF
- <form class="comment" action="/cgi/comment" method="post">
- <input class="misc" type="text" name="url">
+ <form action="/cgi/comment" method="post">
+ <input class="misc-comment-input" type="text" name="url">
<input name="goto" type="hidden" value="#{rel_path}">
<textarea rows="10" name="comment" placeholder="markdown" maxlength="1000"></textarea>
<input type="submit" value="Leave a comment">