markdown-it-any-block 3.3.3 → 3.3.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.
package/docs/README.md CHANGED
@@ -43,6 +43,7 @@ import {} from "./ABConverter/converter/abc_list"
43
43
  import {} from "./ABConverter/converter/abc_table"
44
44
  import {} from "./ABConverter/converter/abc_deco"
45
45
  import {} from "./ABConverter/converter/abc_ex"
46
+ import {} from "./ABConverter/converter/abc_echarts"
46
47
  import {} from "./ABConverter/converter/abc_mermaid" // 可选建议:非 min 环境下 7.1MB
47
48
  import {} from "./ABConverter/converter/abc_markmap" // 可选建议:1.3MB
48
49
 
package/index.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  // JsDom。仅用于提供document对象支持 (如果Ob环境中则不需要,用ob自带document对象的)
2
2
  export { jsdom_init } from './jsdom_init'
3
- export { ab_mdit } from './index_mdit'
3
+ export { ab_mdit, ab_mdit_client } from './index_mdit'
4
4
  export { abConvertEvent } from '../ABConverter/ABConvertEvent'
package/index_mdit.ts CHANGED
@@ -61,6 +61,7 @@ import "../ABConverter/converter/abc_dir_tree"
61
61
  import "../ABConverter/converter/abc_deco"
62
62
  import "../ABConverter/converter/abc_ex"
63
63
  import "../ABConverter/converter/abc_mdit_container"
64
+ import "../ABConverter/converter/abc_echarts"
64
65
  import "../ABConverter/converter/abc_plantuml" // 可选建议:
65
66
  import "../ABConverter/converter/abc_mermaid" // 可选建议:新版无额外依赖,旧版非 min 环境下 7.1MB
66
67
  import "../ABConverter/converter/abc_markmap" // 可选建议:1.3MB
@@ -432,3 +433,20 @@ export function ab_mdit(md: MarkdownIt, options?: Partial<Options>): void {
432
433
  md.use(abSelector_container)
433
434
  md.use(abRender_fence)
434
435
  }
436
+
437
+ export function ab_mdit_client(md: MarkdownIt, options?: Partial<Options>): void {
438
+ // 定义默认渲染行为
439
+ ABConvertManager.getInstance().redefine_renderMarkdown((markdown: string, el: HTMLElement): void => {
440
+ el.classList.add("markdown-rendered")
441
+
442
+ const result: string = md.render(markdown)
443
+ const el_child = document.createElement("div"); el.appendChild(el_child); el_child.innerHTML = result;
444
+ })
445
+
446
+ // 定义环境条件
447
+ ABCSetting.env = "vuepress"
448
+
449
+ md.use(abSelector_squareInline)
450
+ md.use(abSelector_container)
451
+ // md.use(abRender_fence) // [!code hl] client端不在node端渲染,在client阶段再去找fence并渲染
452
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markdown-it-any-block",
3
- "version": "3.3.3",
3
+ "version": "3.3.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",
package/tsconfig.json CHANGED
@@ -19,7 +19,8 @@
19
19
  "DOM",
20
20
  "ES5",
21
21
  "ES6",
22
- "ES7"
22
+ "ES7",
23
+ "ES2021",
23
24
  ]
24
25
  },
25
26
  "include": [