mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
render_markdown: Refactor realm_filters_key logic.
This moves the realm_filter_key variable, primarily used for clarity, up from Bugdown into the render_markdown function. We'll need this for the upcoming commits.
This commit is contained in:
@@ -321,10 +321,11 @@ def render_markdown(message, content, realm_id=None, realm_alert_words=None, mes
|
||||
|
||||
if realm_id is None:
|
||||
realm_id = message.sender.realm_id
|
||||
realm_filters_key = realm_id
|
||||
if message.sending_client.name == "zephyr_mirror" and message.sender.realm.is_zephyr_mirror_realm:
|
||||
# Use slightly customized Markdown processor for content
|
||||
# delivered via zephyr_mirror
|
||||
realm_id = bugdown.ZEPHYR_MIRROR_BUGDOWN_KEY
|
||||
realm_filters_key = bugdown.ZEPHYR_MIRROR_BUGDOWN_KEY
|
||||
|
||||
possible_words = set() # type: Set[Text]
|
||||
if realm_alert_words is not None:
|
||||
@@ -333,7 +334,8 @@ def render_markdown(message, content, realm_id=None, realm_alert_words=None, mes
|
||||
possible_words.update(set(words))
|
||||
|
||||
# DO MAIN WORK HERE -- call bugdown to convert
|
||||
rendered_content = bugdown.convert(content, realm_filters_key=realm_id, message=message,
|
||||
rendered_content = bugdown.convert(content, realm_filters_key=realm_filters_key,
|
||||
message=message,
|
||||
possible_words=possible_words)
|
||||
|
||||
if message is not None:
|
||||
|
||||
Reference in New Issue
Block a user