diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c37f273..cf26bce 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -34,9 +34,8 @@ def twitterize(string) end def clean_content_for(post) - text = post.content + text = post.to_html text.gsub!(/<(script|noscript|object|embed|style|frameset|frame|iframe)[>\s\S]*<\/\1>/, '') if post.from_feed? - text = RedCloth.new(text, [:filter_styles, :no_span_caps]).to_html text = spanify_links(text) end diff --git a/app/models/post.rb b/app/models/post.rb index f557632..b7d51a5 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -45,4 +45,10 @@ def deleted? def link(root='') "#{root}/#{type.tableize}/#{to_param}" end + + def to_html + text = content + text = RedCloth.new(text, [:filter_styles, :no_span_caps]).to_html + end + end