在文件中我们发现:
${...} operator
The ${...} notation is short-hand for text insertion. The Python-expression inside the braces is evaluated and the result included in the output (all inserted text is escaped by default):
<div id="section-${index + 1}"> ${content} </div>
To escape this behavior, prefix the notation with a backslash character:
\${...}
.
如何将content
值呈现为HTML而不是文本?你知道吗
要避免转义,请使用
structure:
前缀:也可以使用
__html__
方法传递对象:更新:
根据要求,下面是一个我认为
__html__
方法应该如何工作的示例。请注意,我不是变色龙用户,此代码未经测试:)在模板中:
相关问题 更多 >
编程相关推荐