placeholder commit, working on mentions in markdown merging.

This commit is contained in:
Brian Wisti 2011-08-30 14:44:49 -07:00
parent 8aafc61071
commit a6e87ebcb2

View file

@ -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 @@ module MarkdownifyHelper
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 @@ module MarkdownifyHelper
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)