假设我有两个变量{{ profile }}
和{{ element.author }}
,它们的值都为“test”。在jinja2中,当我试图使用if语句比较它们时,没有任何内容显示出来。我是这样进行比较的:
{% if profile == element.author %}
{{ profile }} and {{ element.author }} are same
{% else %}
{{ profile }} and {{ element.author }} are **not** same
{% endif %}
我得到了输出结果test and test are not same
。出了什么问题,我应该如何进行比较?