Escaping double quotes while rendering in Jinja2

前端 未结 2 1312
广开言路
广开言路 2021-02-14 07:34

I\'m using Jinja2 to create Golang code using Python3. I need to pass some parameters in quotes to a function in my final code, but Jinja2 isn\'t escaping double quotes. My pyth

2条回答
  •  醉梦人生
    2021-02-14 08:14

    The alternative way to do this would have been

    e.({{ function|safe }})
    

    which prevents auto-escaping.

提交回复
热议问题