You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-12-02 22:49:09 +02:00
All: Include injected Mermaid JS only when necessary
This commit is contained in:
@@ -12,6 +12,10 @@ const { basename, fileExtension } = require('lib/path-utils.js');
|
||||
const { uuid } = require('lib/uuid.js');
|
||||
const Resource = require('lib/models/Resource');
|
||||
|
||||
const injectedJs = {
|
||||
mermaid: require('lib/rnInjectedJs/mermaid'),
|
||||
};
|
||||
|
||||
function shimInit() {
|
||||
shim.Geolocation = GeolocationReact;
|
||||
shim.setInterval = PoorManIntervals.setInterval;
|
||||
@@ -164,6 +168,11 @@ function shimInit() {
|
||||
return resource;
|
||||
}
|
||||
|
||||
shim.injectedJs = function(name) {
|
||||
if (name in injectedJs) return injectedJs[name];
|
||||
return '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = { shimInit };
|
||||
Reference in New Issue
Block a user