Closed smartnio closed 3 weeks ago
When using CDN, we cannot obtain an instance of katex here, and it's currently not possible to get it here either. I will try to enhance it later. Currently, installing via dependencies works:
npm i katex
import { config } from 'md-editor-v3';
import katex from 'katex';
config({
markdownItPlugins(plugins, { editorId }) {
return plugins.map((item) => {
if (item.type === 'katex') {
// will not be undefined
console.log('katexRef', item.options.katexRef.value);
}
return item;
});
},
editorExtensions: {
katex: {
instance: katex
}
}
})
4.19.0中优化了这个问题,参考https://imzbf.github.io/md-editor-v3/zh-CN/docs#%F0%9F%94%A7%20katexConfig
Describe the issue
Hi, i just wanna know how to set options for the katex-plugin within the md-editor-v3 config. I followed the docs with configurating the markdownItPlugins section in the README. But i can't figure out, how to change options for the katex plugin, because the katex options is a vue reactive
katexRef
which is not available on configuration start.I want to set e.g. the strict mode of the plugin to get rid of warnings. They are inside
p.options.katexRef.value.SETTINGS_SCHEMA
If not an issue, can be moved to discussion. But thanks for the help!
Procedure version
4.18..0
Reproduction link
No response