From 1a74af445ca42cffc4f61ccb32f301f127727acd Mon Sep 17 00:00:00 2001 From: Jason <31967657+JasonsCPL@users.noreply.github.com> Date: Fri, 22 Dec 2017 01:50:28 +0800 Subject: [PATCH] add "this" Sorry for my English first. In the closure, the both "typeof" of "document" & "window" are return "undefined" without "this" prefix. But they are under the variable "this". So ... --- src/showdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/showdown.js b/src/showdown.js index 18b8268..94e2cfa 100644 --- a/src/showdown.js +++ b/src/showdown.js @@ -3,7 +3,7 @@ */ // load dependencies -if (typeof document === 'undefined' && typeof window === 'undefined') { +if (typeof this.document === 'undefined' && typeof this.window === 'undefined') { var jsdom = require('jsdom').jsdom, jsdomObj = jsdom('', {}), window = jsdomObj.defaultView, // jshint ignore:line