no need to use discourse event here
This commit is contained in:
parent
a5b0445e02
commit
3f9ed76dad
|
@ -81,10 +81,6 @@ module PrettyText
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
DiscourseEvent.on(:markdown_context) do |context|
|
|
||||||
context.eval('opts["categoryHashtagLookup"] = function(c){return helpers.category_tag_hashtag_lookup(c);}')
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@mutex = Mutex.new
|
@mutex = Mutex.new
|
||||||
|
@ -238,6 +234,7 @@ module PrettyText
|
||||||
context.eval('opts["categoryHashtagLookup"] = function(c){return helpers.category_hashtag_lookup(c);}')
|
context.eval('opts["categoryHashtagLookup"] = function(c){return helpers.category_hashtag_lookup(c);}')
|
||||||
context.eval('opts["lookupAvatar"] = function(p){return Discourse.Utilities.avatarImg({size: "tiny", avatarTemplate: helpers.avatar_template(p)});}')
|
context.eval('opts["lookupAvatar"] = function(p){return Discourse.Utilities.avatarImg({size: "tiny", avatarTemplate: helpers.avatar_template(p)});}')
|
||||||
context.eval('opts["getTopicInfo"] = function(i){return helpers.get_topic_info(i)};')
|
context.eval('opts["getTopicInfo"] = function(i){return helpers.get_topic_info(i)};')
|
||||||
|
context.eval('opts["categoryHashtagLookup"] = function(c){return helpers.category_tag_hashtag_lookup(c);}')
|
||||||
DiscourseEvent.trigger(:markdown_context, context)
|
DiscourseEvent.trigger(:markdown_context, context)
|
||||||
baked = context.eval('Discourse.Markdown.markdownConverter(opts).makeHtml(raw)')
|
baked = context.eval('Discourse.Markdown.markdownConverter(opts).makeHtml(raw)')
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue