Escaping double quotes while rendering in Jinja2

前端 未结 2 1308
广开言路
广开言路 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:23

    This is due to Jinja2 autoescaping. As described in the documentation, the recommended way to avoid this is to wrap the text in a Markup object.

提交回复
热议问题