We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const myBlockHook = Cherry.createSyntaxHook('myBlock', Cherry.constants.HOOKS_TYPE_LIST.PAR, { needCache: true, // 表明要使用缓存,也是实现排他的必要操作 makeHtml(str) { const that = this; return str.replace(this.RULE.reg, function (whole, m1) { const result = `\n<div style="border: 1px solid;border-radius: 15px;background: gold;">${m1}</div>\n`; return that.pushCache(result); // 将结果转成占位符 }); }, rule(str) { return { reg: /\n\+\+(\n[\s\S]+?\n)\+\+\n/g }; }, }); const cherryEngineInstance = new CherryEngine({ engine: { customSyntax: { // importHook: { // syntaxClass: imgHook, // 将自定义语法对象挂载到 importHook.syntaxClass上 // force: true, // true: 当cherry自带的语法中也有一个“importHook”时,用自定义的语法覆盖默认语法; false:不覆盖 // before: 'fontEmphasis', // 定义该自定义语法的执行顺序,当前例子表明在加粗/斜体语法前执行该自定义语法 // }, importHook: { syntaxClass: myBlockHook, // 将自定义语法对象挂载到 importHook.syntaxClass上 // force: true, // true: 当cherry自带的语法中也有一个“importHook”时,用自定义的语法覆盖默认语法; false:不覆盖 before: 'blockquote', // 定义该自定义语法的执行顺序,当前例子表明在加粗/斜体语法前执行该自定义语法 }, }, }, }) cherryEngineInstance.makeHtml(`\n++\n XXX \n++\n`);
No response
None
The text was updated successfully, but these errors were encountered:
CherryEngine 似乎并没有支持,可以考虑 const cherry = new Cherry(),然后用 cherry.engine.makeHtml(md) 实现把md转成html的功能
const cherry = new Cherry()
cherry.engine.makeHtml(md)
Sorry, something went wrong.
No branches or pull requests
Prerequisites
Describe the Bug
Reproduction Steps
No response
System Information
No response
Contributing
None
The text was updated successfully, but these errors were encountered: