correctly hunt for console.log
This commit is contained in:
parent
34867a6e07
commit
da5ccd2000
|
@ -3,8 +3,8 @@ import { sanitize } from 'pretty-text/sanitizer';
|
|||
|
||||
function deprecate(feature, name){
|
||||
return function() {
|
||||
if (console && console.log) {
|
||||
console.log(feature + ': ' + name + ' is deprecated, please use the new markdown it APIs');
|
||||
if (window.console && window.console.log) {
|
||||
window.console.log(feature + ': ' + name + ' is deprecated, please use the new markdown it APIs');
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -74,6 +74,7 @@ module PrettyText
|
|||
|
||||
if Rails.env.development? || Rails.env.test?
|
||||
ctx.attach("console.log", proc { |l| p l })
|
||||
ctx.eval('window.console = console;')
|
||||
end
|
||||
|
||||
ctx_load(ctx, "#{Rails.root}/app/assets/javascripts/discourse-loader.js")
|
||||
|
|
Loading…
Reference in New Issue