mirror of https://github.com/laurent22/joplin.git
All: Disabled Mermaid support for now
parent
fca4fa666d
commit
e30bc12354
|
@ -204,9 +204,10 @@
|
|||
}
|
||||
|
||||
if (document.getElementsByClassName('mermaid').length) {
|
||||
lazyLoadScript('../../node_modules/mermaid/dist/mermaid.min.js', 'mermaidScriptContainer', () => {
|
||||
mermaid.init();
|
||||
});
|
||||
console.warn('Mermaid support is currently disabled');
|
||||
// lazyLoadScript('../../node_modules/mermaid/dist/mermaid.min.js', 'mermaidScriptContainer', () => {
|
||||
// mermaid.init();
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -198,7 +198,8 @@ class MdToHtml {
|
|||
this.rendererPlugins_['mermaid'] = new MdToHtml_Mermaid();
|
||||
}
|
||||
|
||||
return language in this.rendererPlugins_ ? this.rendererPlugins_[language] : null;
|
||||
const plugin = this.rendererPlugins_[language];
|
||||
return plugin && plugin.enabled() ? plugin : null;
|
||||
}
|
||||
|
||||
parseInlineCodeLanguage_(content) {
|
||||
|
|
|
@ -2,10 +2,12 @@ const { shim } = require('lib/shim');
|
|||
const katex = require('katex');
|
||||
const katexCss = require('lib/csstojs/katex.css.js');
|
||||
const Setting = require('lib/models/Setting');
|
||||
const MdToHtml_PluginBase = require('./MdToHtml_PluginBase');
|
||||
|
||||
class MdToHtml_Katex {
|
||||
class MdToHtml_Katex extends MdToHtml_PluginBase {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.cache_ = {};
|
||||
this.assetsLoaded_ = false;
|
||||
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
const { shim } = require('lib/shim');
|
||||
const MdToHtml_PluginBase = require('./MdToHtml_PluginBase');
|
||||
|
||||
class MdToHtml_Mermaid {
|
||||
class MdToHtml_Mermaid extends MdToHtml_PluginBase {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.setEnabled(false);
|
||||
}
|
||||
|
||||
name() {
|
||||
return 'mermaid';
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
class MdToHtml_PluginBase {
|
||||
|
||||
constructor() {
|
||||
this.enabled_ = true;
|
||||
}
|
||||
|
||||
setEnabled(v) {
|
||||
this.enabled_ = v;
|
||||
}
|
||||
|
||||
enabled() {
|
||||
return this.enabled_;
|
||||
}
|
||||
|
||||
disabled() {
|
||||
return !this.enabled();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = MdToHtml_PluginBase;
|
Loading…
Reference in New Issue