def render_incoming_message(message: Message, content: str, user_ids: Set[int], realm: Realm, mention_data: Optional[MentionData]=None, email_gateway: bool=False) -> str:
    realm_alert_words_automaton = get_alert_word_automaton(realm)
    try:
        rendered_content = render_markdown(message=message, content=content, realm=realm, realm_alert_words_automaton=realm_alert_words_automaton, mention_data=mention_data, email_gateway=email_gateway)
    except MarkdownRenderingException:
        raise JsonableError(_('Unable to render message'))
    return rendered_content
def render_incoming_message(message: Message, content: str, user_ids: Set[int], realm: Realm, mention_data: Optional[MentionData]=None, email_gateway: bool=False) -> str:
    realm_alert_words_automaton = get_alert_word_automaton(realm)
    try:
        rendered_content = render_markdown(message=message, content=content, realm=realm, realm_alert_words_automaton=realm_alert_words_automaton, mention_data=mention_data, email_gateway=email_gateway)
    except MarkdownRenderingException:
        raise JsonableError(_('Unable to render message'))
    return rendered_content