templates: Narrow the type of jinjia to Jinja2.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
Zixuan James Li
2022-07-21 20:19:49 -04:00
committed by Tim Abbott
parent 223a1ad0eb
commit 90a31d9e66

View File

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