Python 3.x HTML文件有效,但通过以下方式呈现:jinja2.exceptions.TemplateSyntaxError

Python 3.x HTML文件有效,但通过以下方式呈现:jinja2.exceptions.TemplateSyntaxError,python-3.x,flask,jinja2,Python 3.x,Flask,Jinja2,我正在使用docker实例将adoc文件转换为html。生成html文件时,它会被移动到templates文件夹,这样Flask就可以使用render_模板构造函数检索它,如下所示: if file and allowed_file(file.filename): filename = secure_filename(file.filename) file.save(os.path.join(app.config["upl

我正在使用docker实例将adoc文件转换为html。生成html文件时,它会被移动到templates文件夹,这样Flask就可以使用render_模板构造函数检索它,如下所示:

        if file and allowed_file(file.filename):
            filename = secure_filename(file.filename)
            file.save(os.path.join(app.config["uploads"], filename))
            html = Do_Stuff_Module(uploads, filename).html_file
            return render_template(html)
回溯:

  File "/Users/.../lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "<unknown>", line 167, in template

jinja2.exceptions.TemplateSyntaxError: Missing end of comment tag
正如您可以看到的那样,结束符
}
不在这一行,但是它显示为向下8行,因此它确实是关闭的。不管出于什么原因,Flask中文件的呈现都不喜欢这样。如果我直接打开生成的html,页面将正常显示在浏览器中。我使用过Safari、Firefox和Chrome,它们都不通过脚本呈现页面,而是抛出此错误消息。我在这里遗漏了什么吗?

来自Jinja2文档:“要注释掉模板中某行的一部分,请使用注释语法,该语法默认设置为{#…#}。”
@media screen and (min-width:768px){#toctitle{font-size:1.375em}