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){
|
function deprecate(feature, name){
|
||||||
return function() {
|
return function() {
|
||||||
if (console && console.log) {
|
if (window.console && window.console.log) {
|
||||||
console.log(feature + ': ' + name + ' is deprecated, please use the new markdown it APIs');
|
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?
|
if Rails.env.development? || Rails.env.test?
|
||||||
ctx.attach("console.log", proc { |l| p l })
|
ctx.attach("console.log", proc { |l| p l })
|
||||||
|
ctx.eval('window.console = console;')
|
||||||
end
|
end
|
||||||
|
|
||||||
ctx_load(ctx, "#{Rails.root}/app/assets/javascripts/discourse-loader.js")
|
ctx_load(ctx, "#{Rails.root}/app/assets/javascripts/discourse-loader.js")
|
||||||
|
|
Loading…
Reference in New Issue