markdown-it-any-block 3.4.4-beta2 → 3.4.4

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.
Files changed (2) hide show
  1. package/README.md +9 -2
  2. package/package.json +5 -1
package/README.md CHANGED
@@ -24,9 +24,11 @@ $ pnpm install -D markdown-it-any-block@latest
24
24
  `config.ts`
25
25
 
26
26
  ```ts
27
- import { ab_mdit, jsdom_init } from "markdown-it-any-block/node"
28
- jsdom_init()
27
+ import { ab_mdit } from "markdown-it-any-block"
29
28
 
29
+ // (可选) 如果你要在 node 环境渲染而非 client 中渲染,则加上下面的语句。在 client 端不要这样做
30
+ import { jsdom_init } from "markdown-it-any-block/node"
31
+ jsdom_init()
30
32
  ...
31
33
 
32
34
  const userConfig: UserConfig = {
@@ -43,6 +45,11 @@ const userConfig: UserConfig = {
43
45
  > 例如vuepress中可以创建/修改 `src/.vuepress/styles/index.scss`
44
46
  > 并添加: `@import '../../../node_modules/markdown-it-any-block/styles';`
45
47
 
48
+ > [!WARNING]
49
+ > BREAKCHANGE
50
+ > 3.4.4-beta3 将 jsdom_init 移到了 markdown-it-any-block/node 中。
51
+ > 原本在 markdown-it-any-block 中没有作分离,会存在 client 环境自动排除 jsdom 依赖并警告的问题
52
+
46
53
  ## 扩展补充
47
54
 
48
55
  服务端渲染与客户端渲染
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markdown-it-any-block",
3
- "version": "3.4.4-beta2",
3
+ "version": "3.4.4",
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",
@@ -9,6 +9,10 @@
9
9
  ".": {
10
10
  "import": "./dist/mdit-any-block.js",
11
11
  "require": "./dist/mdit-any-block.cjs"
12
+ },
13
+ "./node": {
14
+ "import": "./dist/mdit-any-block.node.js",
15
+ "require": "./dist/mdit-any-block.node.cjs"
12
16
  }
13
17
  },
14
18
  "scripts": {