const CustomHookA = Cherry.createSyntaxHook('codeBlock', Cherry.constants.HOOKS_TYPE_LIST.PAR, {
makeHtml(str) {
console.warn('custom hook', 'hello');
return str;
},
rule(str) {
const regex = {
begin: '',
content: '',
end: '',
};
regex.reg = new RegExp(regex.begin + regex.content + regex.end, 'g');
return regex;
},
});
const noToolbarConfig = {
id: 'markdown',
externals: {
echarts: window.echarts,
katex: window.katex,
MathJax: window.MathJax,
},
engine: {
global: {},
syntax: {
fontEmphasis: {
allowWhitespace: true,
},
mathBlock: {
engine: 'MathJax',
src: 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js',
},
inlineMath: {
engine: 'MathJax',
},
emoji: {
useUnicode: false,
customResourceURL: 'https://github.githubassets.com/images/icons/emoji/unicode/${code}.png?v8',
upperCase: true,
},
},
customSyntax: {
CustomHook: {
syntaxClass: CustomHookA,
force: false,
after: 'br',
},
},
},
toolbars: {
showToolbar: false,
toolbar: false,
bubble: false,
float: false,
},
editor: {
defaultModel: 'edit&preview',
codemirror: {
placeholder: '请输入内容...',
},
},
previewer: {
},
keydown: [],
urlProcessor(url, srcType) {
console.log(`url-processor`, url, srcType);
return url;
},
};
export { noToolbarConfig };