@anyblock/remark-any-block 1.0.0-beta3 → 1.0.0-beta5

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/README.md CHANGED
@@ -30,7 +30,7 @@ $ npm publish --tag beta # 如果使用测试或beta版本 (包含 `-tagname`)
30
30
  ```
31
31
 
32
32
  > [!warning]
33
- > 补丁: 2025-12-09 开始不再能使用长期验证方式,得用 `npm login`
33
+ > 补丁: 2025-12-09 开始不再能使用长期验证方式,得每次都要 `npm login` 一下
34
34
  >
35
35
  > 否则报错:
36
36
  > ```bash
package/anyblock.ts CHANGED
@@ -187,7 +187,8 @@ export const remark_anyblock_to_codeblock: Plugin<[Partial<AnyBlockOptions>?], R
187
187
  }
188
188
 
189
189
  // 渲染 anyblock 代码块
190
- const remark_anyblock_render_codeblock = () => {
190
+ export const remark_anyblock_render_codeblock = () => {
191
+ if (!document) return
191
192
  return (tree: Root, _file: VFile) => {
192
193
  visit(tree, "code", (node: Code, index: number|undefined, parent: any|undefined) => { // 遍历所有的 code 类型节点
193
194
  console.log("\nanyblock codeblock transformer visit:", node)
@@ -222,7 +223,7 @@ const remark_anyblock_render_codeblock = () => {
222
223
 
223
224
  {
224
225
  // 定义环境条件
225
- ABCSetting.env = "markdown-it"; // remark
226
+ ABCSetting.env = "remark";
226
227
 
227
228
  // 定义默认渲染行为 // [!code hl] risk 同步适配异步,可能会存在问题
228
229
  ABConvertManager.getInstance().redefine_renderMarkdown((markdown: string, el: HTMLElement):void => {