Permalink
Browse files

placeholder commit, working on mentions in markdown merging.

  • Loading branch information...
1 parent 8aafc61 commit a6e87ebcb21733a0a7ec9e61724d98434c6c5272 @brianwisti committed Aug 30, 2011
Showing with 6 additions and 4 deletions.
  1. +6 −4 app/helpers/markdownify_helper.rb
@@ -5,8 +5,7 @@
require File.expand_path("#{Rails.root}/lib/diaspora/markdownify")
module MarkdownifyHelper
- def markdownify(message, render_options={})
- return '' if message.blank?
+ def markdownify(target, render_options={})
markdown_options = {
:autolink => true,
@@ -19,8 +18,6 @@ def markdownify(message, render_options={})
render_options[:filter_html] = true
- renderer = Diaspora::Markdownify::HTML.new(render_options)
- markdown = Redcarpet::Markdown.new(renderer, markdown_options)
# This ugly little hack basically means
# "Give me the rawest contents of target available"
@@ -32,6 +29,11 @@ def markdownify(message, render_options={})
message = target.to_s
end
+ return '' if message.blank?
+
+ renderer = Diaspora::Markdownify::HTML.new(render_options)
+ markdown = Redcarpet::Markdown.new(renderer, markdown_options)
+
message = markdown.render(message)
if target.respond_to?(:format_mentions)

0 comments on commit a6e87eb

Please sign in to comment.