mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 18:36:36 +00:00
The Markdown processor makes it fairly simple for the helper classes to access the `md` engine. We now write `_md_engine.zulip_message` to avoid having the current message in the global namespace. Note that we do reuse engines for multiple messages, but each engine is specific to a realm. And we therefore avoid even the theoretical possibility of leaking message data between realms.
11 lines
363 B
Python
11 lines
363 B
Python
from typing import Any, Dict, Optional
|
|
|
|
from zerver.models import Message, Realm
|
|
|
|
current_realm = None # type: Optional[Realm]
|
|
|
|
# We avoid doing DB queries in our markdown thread to avoid the overhead of
|
|
# opening a new DB connection. These connections tend to live longer than the
|
|
# threads themselves, as well.
|
|
db_data = None # type: Optional[Dict[str, Any]]
|