Add DiscourseEvent hook when converting raw post to markdown.

This commit is contained in:
Guo Xiang Tan 2016-01-29 13:30:12 +08:00
parent 90100378b8
commit 190345ba20

View file

@ -218,6 +218,7 @@ module PrettyText
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["getTopicInfo"] = function(i){return helpers.get_topic_info(i)};')
DiscourseEvent.trigger(:markdown_context, context)
baked = context.eval('Discourse.Markdown.markdownConverter(opts).makeHtml(raw)')
end