mirror of
https://github.com/zulip/zulip.git
synced 2025-10-29 11:03:54 +00:00
templates: Narrow the type of jinjia to Jinja2.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
committed by
Tim Abbott
parent
223a1ad0eb
commit
90a31d9e66
@@ -10,6 +10,7 @@ import orjson
|
||||
from django.conf import settings
|
||||
from django.contrib.staticfiles.storage import staticfiles_storage
|
||||
from django.template import Library, engines
|
||||
from django.template.backends.jinja2 import Jinja2
|
||||
from django.utils.safestring import mark_safe
|
||||
from jinja2.exceptions import TemplateNotFound
|
||||
|
||||
@@ -156,6 +157,7 @@ def render_markdown_path(
|
||||
# By default, we do both Jinja2 templating and Markdown
|
||||
# processing on the file, to make it easy to use both Jinja2
|
||||
# context variables and markdown includes in the file.
|
||||
assert isinstance(jinja, Jinja2)
|
||||
markdown_string = jinja.env.loader.get_source(jinja.env, markdown_file_path)[0]
|
||||
except TemplateNotFound as e:
|
||||
if pure_markdown:
|
||||
|
||||
Reference in New Issue
Block a user