diff --git a/lib/pretty_text.rb b/lib/pretty_text.rb index ee5aa578331..98390edd6e6 100644 --- a/lib/pretty_text.rb +++ b/lib/pretty_text.rb @@ -128,7 +128,9 @@ module PrettyText context.eval("Discourse.SiteSettings = #{SiteSetting.client_settings_json};") context.eval("Discourse.CDN = '#{Rails.configuration.action_controller.asset_host}';") context.eval("Discourse.BaseUrl = 'http://#{RailsMultisite::ConnectionManagement.current_hostname}';") - context.eval("Discourse.getURL = function(url) {return '#{Discourse::base_uri}' + url};") + + context.eval("Discourse.getURL = function(url) { return '#{Discourse::base_uri}' + url };") + context.eval("Discourse.getURLWithCDN = function(url) { url = Discourse.getURL(url); if (Discourse.CDN) { url = Discourse.CDN + url; } return url; };") end def self.markdown(text, opts=nil)