mirror of
https://github.com/zulip/zulip.git
synced 2025-10-29 11:03:54 +00:00
markdown: Pass in page_params.realm_filters to initialize().
This commit is contained in:
@@ -190,7 +190,7 @@ run_test('fenced_block_defaults', () => {
|
|||||||
assert.equal(output, expected);
|
assert.equal(output, expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
markdown.initialize();
|
markdown.initialize(page_params.realm_filters);
|
||||||
|
|
||||||
const bugdown_data = global.read_fixture_data('markdown_test_cases.json');
|
const bugdown_data = global.read_fixture_data('markdown_test_cases.json');
|
||||||
|
|
||||||
|
|||||||
@@ -379,7 +379,7 @@ exports.update_realm_filter_rules = function (realm_filters) {
|
|||||||
marked.InlineLexer.rules.zulip.realm_filters = marked_rules;
|
marked.InlineLexer.rules.zulip.realm_filters = marked_rules;
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.initialize = function () {
|
exports.initialize = function (realm_filters) {
|
||||||
|
|
||||||
function disable_markdown_regex(rules, name) {
|
function disable_markdown_regex(rules, name) {
|
||||||
rules[name] = {exec: function () {
|
rules[name] = {exec: function () {
|
||||||
@@ -446,7 +446,7 @@ exports.initialize = function () {
|
|||||||
// Disable autolink as (a) it is not used in our backend and (b) it interferes with @mentions
|
// Disable autolink as (a) it is not used in our backend and (b) it interferes with @mentions
|
||||||
disable_markdown_regex(marked.InlineLexer.rules.zulip, 'autolink');
|
disable_markdown_regex(marked.InlineLexer.rules.zulip, 'autolink');
|
||||||
|
|
||||||
exports.update_realm_filter_rules(page_params.realm_filters);
|
exports.update_realm_filter_rules(realm_filters);
|
||||||
|
|
||||||
// Tell our fenced code preprocessor how to insert arbitrary
|
// Tell our fenced code preprocessor how to insert arbitrary
|
||||||
// HTML into the output. This generated HTML is safe to not escape
|
// HTML into the output. This generated HTML is safe to not escape
|
||||||
|
|||||||
@@ -326,7 +326,7 @@ exports.initialize_everything = function () {
|
|||||||
message_fetch.initialize();
|
message_fetch.initialize();
|
||||||
message_scroll.initialize();
|
message_scroll.initialize();
|
||||||
emoji.initialize();
|
emoji.initialize();
|
||||||
markdown.initialize(); // Must happen after emoji.initialize()
|
markdown.initialize(page_params.realm_filters); // Must happen after emoji.initialize()
|
||||||
compose.initialize();
|
compose.initialize();
|
||||||
composebox_typeahead.initialize(); // Must happen after compose.initialize()
|
composebox_typeahead.initialize(); // Must happen after compose.initialize()
|
||||||
search.initialize();
|
search.initialize();
|
||||||
|
|||||||
Reference in New Issue
Block a user