@speajus/markdown-to-pdf 1.0.22 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mermaid-renderer.js +3 -9
- package/package.json +1 -1
package/dist/mermaid-renderer.js
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.renderMermaidToPng = renderMermaidToPng;
|
|
7
4
|
exports.cleanupMermaid = cleanupMermaid;
|
|
8
5
|
const defaults_js_1 = require("./defaults.js");
|
|
9
|
-
const isomorphic_dompurify_1 = __importDefault(require("isomorphic-dompurify"));
|
|
10
6
|
let mermaidModule = null;
|
|
11
7
|
async function loadMermaid() {
|
|
12
8
|
if (!mermaidModule) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (!globalThis.DOMPurify) {
|
|
17
|
-
globalThis.DOMPurify = isomorphic_dompurify_1.default;
|
|
9
|
+
const win = ('window' in globalThis) ? globalThis.window : (globalThis.window = globalThis);
|
|
10
|
+
if (!('DOMPurify' in win)) {
|
|
11
|
+
win.DOMPurify = await import("isomorphic-dompurify");
|
|
18
12
|
}
|
|
19
13
|
mermaidModule = await import('@speajus/mermaid-to-svg');
|
|
20
14
|
}
|