From 190345ba20a84a7cf9597c3facd418dbefbd7748 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 29 Jan 2016 13:30:12 +0800 Subject: [PATCH] Add DiscourseEvent hook when converting raw post to markdown. --- lib/pretty_text.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pretty_text.rb b/lib/pretty_text.rb index d952373ab8b..a7b62a83d15 100644 --- a/lib/pretty_text.rb +++ b/lib/pretty_text.rb @@ -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