Permalink
Browse files

mod: add content cache for comments

  • Loading branch information...
1 parent c5edad2 commit 5ea81b55004e9647f7caf798641becaa2a9153f0 @qiao committed Sep 19, 2011
@@ -14,7 +14,7 @@
<div class="comment_info">
<%= comment.created_at.to_s(:db) %>
</div>
- <%= simple_format(comment.content) %>
+ <%= raw(comment.content) %>
</div>
<div class="clear"></div>
<% end %>
@@ -17,7 +17,7 @@
<%= f.label :author_url, 'Website' %>
</div>
<div class="field">
- <%= f.text_area :content, :id => nil %>
+ <%= f.text_area :raw_content, :id => nil %>
</div>
<div class="actions">
<%= f.submit 'Submit', :id => nil %>
@@ -1,12 +1,12 @@
module MarkdownWithSyntax
- def markdown_with_syntax(text, *options)
- html = syntax_highlight(markdown(text, *options)).html_safe
+ def markdown_with_syntax(text)
+ syntax_highlight(markdown(text)).html_safe
end
- def markdown(text, *options)
+ def markdown(text)
defaults = [:hard_wrap, :autolink, :no_intraemphasis,
:fenced_code, :gh_blockcode]
- Redcarpet.new(text, *(defaults | options)).to_html
+ Redcarpet.new(text, *defaults).to_html
end
def syntax_highlight(text)

0 comments on commit 5ea81b5

Please sign in to comment.