Skip to content

Commit

Permalink
Fix the shape of insane.js to make it ESM compatible (microsoft/monac…
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Sep 30, 2019
1 parent fe9e05d commit 3ff057c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/vs/base/browser/markdownRenderer.ts
Expand Up @@ -9,7 +9,7 @@ import { onUnexpectedError } from 'vs/base/common/errors';
import { IMarkdownString, parseHrefAndDimensions, removeMarkdownEscapes } from 'vs/base/common/htmlContent';
import { defaultGenerator } from 'vs/base/common/idGenerator';
import * as marked from 'vs/base/common/marked/marked';
import * as insane from 'vs/base/common/insane/insane';
import { insane } from 'vs/base/common/insane/insane';
import { parse } from 'vs/base/common/marshalling';
import { cloneAndChange } from 'vs/base/common/objects';
import { escape } from 'vs/base/common/strings';
Expand Down
8 changes: 1 addition & 7 deletions src/vs/base/common/insane/insane.d.ts
Expand Up @@ -3,11 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

export as namespace insane;

export = insane;

declare function insane(
export function insane(
html: string,
options?: {
readonly allowedSchemes?: readonly string[],
Expand All @@ -16,5 +12,3 @@ declare function insane(
},
strict?: boolean,
): string;

declare namespace insane { }
18 changes: 7 additions & 11 deletions src/vs/base/common/insane/insane.js
Expand Up @@ -21,11 +21,7 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

// ESM-comment-begin
let __insane_exports;
// ESM-comment-end


let __insane_func;

(function () { function r(e, n, t) { function o(i, f) { if (!n[i]) { if (!e[i]) { var c = "function" == typeof require && require; if (!f && c) return c(i, !0); if (u) return u(i, !0); var a = new Error("Cannot find module '" + i + "'"); throw a.code = "MODULE_NOT_FOUND", a } var p = n[i] = { exports: {} }; e[i][0].call(p.exports, function (r) { var n = e[i][1][r]; return o(n || r) }, p, p.exports, r, e, n, t) } return n[i].exports } for (var u = "function" == typeof require && require, i = 0; i < t.length; i++)o(t[i]); return o } return r })()({
1: [function (require, module, exports) {
Expand Down Expand Up @@ -92,7 +88,7 @@ let __insane_exports;

insane.defaults = defaults;
module.exports = insane;
__insane_exports = insane;
__insane_func = insane;

}, { "./defaults": 2, "./parser": 7, "./sanitizer": 8, "assignment": 6, "he": 9 }], 5: [function (require, module, exports) {
'use strict';
Expand Down Expand Up @@ -469,10 +465,10 @@ let __insane_exports;
}, {}]
}, {}, [4]);

// BEGIN MONACOCHANGE
// __marked_exports = marked;
// }).call(this);

// ESM-comment-begin
define(function() { return __insane_exports; });
define(function() { return { insane: __insane_func }; });
// ESM-comment-end

// ESM-uncomment-begin
// export var insane = __insane_func;
// ESM-uncomment-end

0 comments on commit 3ff057c

Please sign in to comment.