我正在使用 Flask render_template 方法来渲染我的 html 页面,如下所示:
render_template('index.html', content="<div>Hello World!</div>")
我的index.html是:
<html lang="en">
<head>
<title>Hello</title>
</head>
<body>
{{content}}
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我的页面正在替换内容变量,但它呈现<div>Hello World!</div>为文本。
有没有办法从 render_template 上下文变量渲染 html?