diff --git a/.eslintrc.json b/.eslintrc.json index bd48b759ba..27f4d2204d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -169,7 +169,6 @@ "localstorage": false, "location": false, "markdown": false, - "marked": false, "message_edit": false, "message_edit_history": false, "message_events": false, diff --git a/frontend_tests/node_tests/markdown.js b/frontend_tests/node_tests/markdown.js index c3a4900fba..22bcb313d7 100644 --- a/frontend_tests/node_tests/markdown.js +++ b/frontend_tests/node_tests/markdown.js @@ -1,10 +1,10 @@ zrequire("hash_util"); -set_global("marked", zrequire("marked", "third/marked/lib/marked")); const emoji = zrequire("emoji", "shared/js/emoji"); const emoji_codes = zrequire("emoji_codes", "generated/emoji/emoji_codes.json"); const fenced_code = zrequire("fenced_code", "shared/js/fenced_code"); const markdown_config = zrequire("markdown_config"); +const marked = zrequire("marked", "third/marked/lib/marked"); zrequire("markdown"); zrequire("message_store"); diff --git a/frontend_tests/node_tests/markdown_katex.js b/frontend_tests/node_tests/markdown_katex.js index 7f9dc0b738..76e54e7102 100644 --- a/frontend_tests/node_tests/markdown_katex.js +++ b/frontend_tests/node_tests/markdown_katex.js @@ -9,7 +9,6 @@ const rewiremock = require("rewiremock/node"); const markdown_config = zrequire("markdown_config"); -set_global("marked", zrequire("marked", "third/marked/lib/marked")); set_global("page_params", {}); zrequire("hash_util"); diff --git a/frontend_tests/node_tests/stream_data.js b/frontend_tests/node_tests/stream_data.js index f35f227937..3ef38dff35 100644 --- a/frontend_tests/node_tests/stream_data.js +++ b/frontend_tests/node_tests/stream_data.js @@ -17,7 +17,6 @@ zrequire("stream_topic_history"); zrequire("people"); zrequire("stream_color"); zrequire("stream_data"); -zrequire("marked", "third/marked/lib/marked"); zrequire("FetchStatus", "js/fetch_status"); zrequire("Filter", "js/filter"); zrequire("MessageListData", "js/message_list_data"); diff --git a/frontend_tests/node_tests/typeahead_helper.js b/frontend_tests/node_tests/typeahead_helper.js index 0f01c33c9b..5354617ec1 100644 --- a/frontend_tests/node_tests/typeahead_helper.js +++ b/frontend_tests/node_tests/typeahead_helper.js @@ -12,7 +12,6 @@ zrequire("people"); zrequire("stream_data"); zrequire("narrow"); zrequire("hash_util"); -zrequire("marked", "third/marked/lib/marked"); const emoji = zrequire("emoji", "shared/js/emoji"); const pygments_data = zrequire("pygments_data", "generated/pygments_data.json"); diff --git a/frontend_tests/node_tests/ui_init.js b/frontend_tests/node_tests/ui_init.js index 9a03b26ae8..57a60d6868 100644 --- a/frontend_tests/node_tests/ui_init.js +++ b/frontend_tests/node_tests/ui_init.js @@ -94,7 +94,6 @@ zrequire("search_pill_widget"); zrequire("user_groups"); zrequire("unread"); zrequire("bot_data"); -set_global("marked", zrequire("marked", "third/marked/lib/marked")); zrequire("markdown"); zrequire("upload"); zrequire("compose"); diff --git a/static/js/bundles/app.js b/static/js/bundles/app.js index 03a78b618f..7b6998744e 100644 --- a/static/js/bundles/app.js +++ b/static/js/bundles/app.js @@ -6,7 +6,6 @@ import "../../third/bootstrap-typeahead/typeahead.js"; import "jquery-caret-plugin/src/jquery.caret.js"; import "../../third/jquery-idle/jquery.idle.js"; import "spectrum-colorpicker"; -import "../../third/marked/lib/marked.js"; import "jquery-validation/dist/jquery.validate.js"; import "winchan/winchan.js"; import "handlebars/dist/cjs/handlebars.runtime.js"; diff --git a/static/js/markdown.js b/static/js/markdown.js index abf749b358..ddba285d02 100644 --- a/static/js/markdown.js +++ b/static/js/markdown.js @@ -3,6 +3,7 @@ const _ = require("lodash"); const emoji = require("../shared/js/emoji"); const fenced_code = require("../shared/js/fenced_code"); +const marked = require("../third/marked/lib/marked"); // This contains zulip's frontend markdown implementation; see // docs/subsystems/markdown.md for docs on our Markdown syntax. The other diff --git a/static/js/zcommand.js b/static/js/zcommand.js index b5ddee8fb8..f50d47eea3 100644 --- a/static/js/zcommand.js +++ b/static/js/zcommand.js @@ -1,3 +1,5 @@ +const marked = require("../third/marked/lib/marked"); + /* What in the heck is a zcommand? diff --git a/tools/webpack.config.ts b/tools/webpack.config.ts index c0c128efc8..79a9464ed7 100644 --- a/tools/webpack.config.ts +++ b/tools/webpack.config.ts @@ -244,7 +244,6 @@ export default (env?: string): webpack.Configuration[] => { // Good error messages show up in production and development in the source maps const exposeOptions = [ {path: "./debug-require.js", name: "require"}, - {path: "../static/third/marked/lib/marked.js"}, {path: "../static/js/debug.js"}, {path: "jquery/dist/jquery.js", name: ["$", "jQuery"]}, {path: "handlebars/dist/cjs/handlebars.runtime.js", name: "Handlebars"},