Skip to content

Commit a155b73

Browse files
committed
copy marked.cjs to marked.js and revert loading
1 parent f237e24 commit a155b73

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

nbclassic/static/base/js/markdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ define([
66
'base/js/utils',
77
'base/js/mathjaxutils',
88
'base/js/security',
9-
'components/marked/lib/marked.umd',
9+
'components/marked/lib/marked',
1010
'codemirror/lib/codemirror',
1111
], function($, utils, mathjaxutils, security, marked, CodeMirror){
1212
"use strict";

nbclassic/static/notebook/js/shortcuteditor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ define([
55
"jquery",
66
"notebook/js/quickhelp",
77
"base/js/dialog",
8-
"components/marked/lib/marked.umd"
8+
"components/marked/lib/marked"
99
], function (
1010
$,
1111
QH,

nbclassic/static/tree/js/notebooklist.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ define([
1111
'base/js/keyboard',
1212
'moment',
1313
'bidi/bidi',
14-
'components/marked/lib/marked.umd'
14+
'components/marked/lib/marked'
1515
], function($, IPython, utils, i18n, dialog, events, keyboard, moment, bidi, marked) {
1616
"use strict";
1717

setupbase.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def find_package_data():
145145
pjoin(components, "jquery-ui", "dist", "jquery-ui.min.js"),
146146
pjoin(components, "jquery-ui", "dist", "themes", "smoothness", "jquery-ui.min.css"),
147147
pjoin(components, "jquery-ui", "dist", "themes", "smoothness", "images", "*"),
148-
pjoin(components, "marked", "lib", "marked.umd.js"),
148+
pjoin(components, "marked", "lib", "marked.js"),
149149
pjoin(components, "react", "react.production.min.js"),
150150
pjoin(components, "react", "react-dom.production.min.js"),
151151
pjoin(components, "requirejs", "require.js"),
@@ -417,6 +417,8 @@ def run(self):
417417
cwd=repo_root,
418418
env=env
419419
)
420+
# Copy the CommonJS files to their JavaScript equivalent to ensure correct loading.
421+
shutil.copyfile(pjoin(self.bower_dir, "marked", "lib", "marked.cjs"), pjoin(self.bower_dir, "marked", "lib", "marked.js"))
420422
except OSError as e:
421423
print("Failed to run bower: %s" % e, file=sys.stderr)
422424
print("You can install js dependencies with `npm install`", file=sys.stderr)

0 commit comments

Comments
 (0)