cherry-markdown
cherry-markdown copied to clipboard
[Bug Report] 自定义语法makeHtml异步问题
Prerequisites
- [X] There isn't an existing issue that reports the same bug to avoid duplicates.
- [X] The provided information offers a minimal reproducible example of the bug.
- [X] For Q&A, please open a GitHub Discussion instead.
Describe the Bug
import Cherry from 'cherry-markdown'
export const NameDynamicLinkHook = Cherry.createSyntaxHook(
'nameDynamicLink',
Cherry.constants.HOOKS_TYPE_LIST.SEN,
{
async makeHtml(str) {
if (this.RULE.reg.test(str)) {
const str = await new Promise((resolve) => {
setTimeout(() => {
resolve('123')
}, 1000)
})
return str
}
return str
},
rule(str) {
return {
reg: /\[__DYNAMIC_NAME__\]\(.+?\)/g,
}
},
},
)
当makeHtml为异步函数时会报错,期望支持一下异步
Reproduction Steps
No response
System Information
No response
Contributing
None
收到,异步语法是我们今年的目标之一,会排期实现哈