markdown-it-any-block 3.3.7-beta1 → 3.3.7-beta2
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/mdit-any-block.cjs +1 -1
- package/dist/mdit-any-block.js +1 -1
- package/jsdom_init.ts +1 -1
- package/package.json +1 -1
package/dist/mdit-any-block.cjs
CHANGED
|
@@ -25,7 +25,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
25
25
|
const MarkdownIt = require("markdown-it");
|
|
26
26
|
let dom = null;
|
|
27
27
|
async function jsdom_init(enable = true) {
|
|
28
|
-
if (document) return;
|
|
28
|
+
if (typeof document !== "undefined") return;
|
|
29
29
|
const { default: jsdom } = await import("jsdom");
|
|
30
30
|
const { JSDOM } = jsdom;
|
|
31
31
|
dom = new JSDOM(`<!DOCTYPE html><html><body></body></html>`, {
|
package/dist/mdit-any-block.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import MarkdownIt from "markdown-it";
|
|
2
2
|
let dom = null;
|
|
3
3
|
async function jsdom_init(enable = true) {
|
|
4
|
-
if (document) return;
|
|
4
|
+
if (typeof document !== "undefined") return;
|
|
5
5
|
const { default: jsdom } = await import("jsdom");
|
|
6
6
|
const { JSDOM } = jsdom;
|
|
7
7
|
dom = new JSDOM(`<!DOCTYPE html><html><body></body></html>`, {
|
package/jsdom_init.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
let dom: any = null;
|
|
10
10
|
|
|
11
11
|
export async function jsdom_init(enable: boolean = true) {
|
|
12
|
-
if (document) return // 客户端环境,无需 jsdom 环境,同时也避免误卸载 document 环境
|
|
12
|
+
if (typeof document !== "undefined") return // 客户端环境,无需 jsdom 环境,同时也避免误卸载 document 环境
|
|
13
13
|
const { default: jsdom } = await import('jsdom') // 废弃,要同步,避免docuemnt初始化不及时
|
|
14
14
|
const { JSDOM } = jsdom
|
|
15
15
|
dom = new JSDOM(`<!DOCTYPE html><html><body></body></html>`, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markdown-it-any-block",
|
|
3
|
-
"version": "3.3.7-
|
|
3
|
+
"version": "3.3.7-beta2",
|
|
4
4
|
"description": "You can flexibility to create a 'Block' by many means. It also provides many useful features, like `list to table`. (obsidian/markdown-it/vuepress plugin/app)",
|
|
5
5
|
"types": "@types/index_mdit.d.ts",
|
|
6
6
|
"type": "module",
|