js: Use Marked.js as a module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2020-07-27 15:31:25 -07:00 committed by Tim Abbott
parent bcab7efb37
commit 1d59fc272c
10 changed files with 4 additions and 8 deletions

View File

@ -169,7 +169,6 @@
"localstorage": false, "localstorage": false,
"location": false, "location": false,
"markdown": false, "markdown": false,
"marked": false,
"message_edit": false, "message_edit": false,
"message_edit_history": false, "message_edit_history": false,
"message_events": false, "message_events": false,

View File

@ -1,10 +1,10 @@
zrequire("hash_util"); zrequire("hash_util");
set_global("marked", zrequire("marked", "third/marked/lib/marked"));
const emoji = zrequire("emoji", "shared/js/emoji"); const emoji = zrequire("emoji", "shared/js/emoji");
const emoji_codes = zrequire("emoji_codes", "generated/emoji/emoji_codes.json"); const emoji_codes = zrequire("emoji_codes", "generated/emoji/emoji_codes.json");
const fenced_code = zrequire("fenced_code", "shared/js/fenced_code"); const fenced_code = zrequire("fenced_code", "shared/js/fenced_code");
const markdown_config = zrequire("markdown_config"); const markdown_config = zrequire("markdown_config");
const marked = zrequire("marked", "third/marked/lib/marked");
zrequire("markdown"); zrequire("markdown");
zrequire("message_store"); zrequire("message_store");

View File

@ -9,7 +9,6 @@ const rewiremock = require("rewiremock/node");
const markdown_config = zrequire("markdown_config"); const markdown_config = zrequire("markdown_config");
set_global("marked", zrequire("marked", "third/marked/lib/marked"));
set_global("page_params", {}); set_global("page_params", {});
zrequire("hash_util"); zrequire("hash_util");

View File

@ -17,7 +17,6 @@ zrequire("stream_topic_history");
zrequire("people"); zrequire("people");
zrequire("stream_color"); zrequire("stream_color");
zrequire("stream_data"); zrequire("stream_data");
zrequire("marked", "third/marked/lib/marked");
zrequire("FetchStatus", "js/fetch_status"); zrequire("FetchStatus", "js/fetch_status");
zrequire("Filter", "js/filter"); zrequire("Filter", "js/filter");
zrequire("MessageListData", "js/message_list_data"); zrequire("MessageListData", "js/message_list_data");

View File

@ -12,7 +12,6 @@ zrequire("people");
zrequire("stream_data"); zrequire("stream_data");
zrequire("narrow"); zrequire("narrow");
zrequire("hash_util"); zrequire("hash_util");
zrequire("marked", "third/marked/lib/marked");
const emoji = zrequire("emoji", "shared/js/emoji"); const emoji = zrequire("emoji", "shared/js/emoji");
const pygments_data = zrequire("pygments_data", "generated/pygments_data.json"); const pygments_data = zrequire("pygments_data", "generated/pygments_data.json");

View File

@ -94,7 +94,6 @@ zrequire("search_pill_widget");
zrequire("user_groups"); zrequire("user_groups");
zrequire("unread"); zrequire("unread");
zrequire("bot_data"); zrequire("bot_data");
set_global("marked", zrequire("marked", "third/marked/lib/marked"));
zrequire("markdown"); zrequire("markdown");
zrequire("upload"); zrequire("upload");
zrequire("compose"); zrequire("compose");

View File

@ -6,7 +6,6 @@ import "../../third/bootstrap-typeahead/typeahead.js";
import "jquery-caret-plugin/src/jquery.caret.js"; import "jquery-caret-plugin/src/jquery.caret.js";
import "../../third/jquery-idle/jquery.idle.js"; import "../../third/jquery-idle/jquery.idle.js";
import "spectrum-colorpicker"; import "spectrum-colorpicker";
import "../../third/marked/lib/marked.js";
import "jquery-validation/dist/jquery.validate.js"; import "jquery-validation/dist/jquery.validate.js";
import "winchan/winchan.js"; import "winchan/winchan.js";
import "handlebars/dist/cjs/handlebars.runtime.js"; import "handlebars/dist/cjs/handlebars.runtime.js";

View File

@ -3,6 +3,7 @@ const _ = require("lodash");
const emoji = require("../shared/js/emoji"); const emoji = require("../shared/js/emoji");
const fenced_code = require("../shared/js/fenced_code"); const fenced_code = require("../shared/js/fenced_code");
const marked = require("../third/marked/lib/marked");
// This contains zulip's frontend markdown implementation; see // This contains zulip's frontend markdown implementation; see
// docs/subsystems/markdown.md for docs on our Markdown syntax. The other // docs/subsystems/markdown.md for docs on our Markdown syntax. The other

View File

@ -1,3 +1,5 @@
const marked = require("../third/marked/lib/marked");
/* /*
What in the heck is a zcommand? What in the heck is a zcommand?

View File

@ -244,7 +244,6 @@ export default (env?: string): webpack.Configuration[] => {
// Good error messages show up in production and development in the source maps // Good error messages show up in production and development in the source maps
const exposeOptions = [ const exposeOptions = [
{path: "./debug-require.js", name: "require"}, {path: "./debug-require.js", name: "require"},
{path: "../static/third/marked/lib/marked.js"},
{path: "../static/js/debug.js"}, {path: "../static/js/debug.js"},
{path: "jquery/dist/jquery.js", name: ["$", "jQuery"]}, {path: "jquery/dist/jquery.js", name: ["$", "jQuery"]},
{path: "handlebars/dist/cjs/handlebars.runtime.js", name: "Handlebars"}, {path: "handlebars/dist/cjs/handlebars.runtime.js", name: "Handlebars"},