Jinja 2 safe keyword

前端 未结 3 1209
故里飘歌
故里飘歌 2021-02-04 01:28

I have a little problem understanding what an expression like {{ something.render() | safe }} does .

From what I have seen, without the safe ke

3条回答
  •  抹茶落季
    2021-02-04 02:03

    The safe filter explicitly marks a string as "safe", i.e., it should not be automatically-escaped if auto-escaping is enabled.

    The documentation on this filter is here.

    See the section on manual escaping to see which characters qualify for escaping.

提交回复
热议问题