placeholder commit, working on mentions in markdown merging.
This commit is contained in:
parent
8aafc61071
commit
a6e87ebcb2
1 changed files with 6 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue