1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-24 06:13:17 +00:00

Don't use CodeMirror unless in the browser

Avoids crashes when rendering static tiddlers under Node.js that include edit widgets with CodeMirror.

The tiddler "SampleWindowTemplate" in 05606f72ad was triggering a build error in https://github.com/Jermolene/TiddlyWiki5/runs/4310561088?check_suite_focus=true#step:6:41
This commit is contained in:
jeremy@jermolene.com 2021-11-24 10:41:38 +00:00
parent 05606f72ad
commit 2af632a46d

View File

@ -252,6 +252,6 @@ CodeMirrorEngine.prototype.executeTextOperation = function(operation) {
return newText;
};
exports.CodeMirrorEngine = CodeMirrorEngine;
exports.CodeMirrorEngine = $tw.browser ? CodeMirrorEngine : require("$:/core/modules/editor/engines/simple.js").SimpleEngine;
})();