@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 +1 -1
- package/anyblock.ts +3 -2
- package/dist/remark-any-block.cjs +2588 -1018
- package/dist/remark-any-block.js +2588 -1018
- package/index.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
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 = "
|
|
226
|
+
ABCSetting.env = "remark";
|
|
226
227
|
|
|
227
228
|
// 定义默认渲染行为 // [!code hl] risk 同步适配异步,可能会存在问题
|
|
228
229
|
ABConvertManager.getInstance().redefine_renderMarkdown((markdown: string, el: HTMLElement):void => {
|