markdown: Pass in page_params.realm_filters to initialize().

This commit is contained in:
Steve Howell
2020-02-17 13:49:17 +00:00
committed by Tim Abbott
parent d55510b57d
commit f603710cd1
3 changed files with 4 additions and 4 deletions

View File

@@ -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');

View File

@@ -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

View File

@@ -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();