escape problem in django templates

前端 未结 3 1221
挽巷
挽巷 2021-02-08 15:27

Let\'s say that I have this string:

s = \'

Hello!

\'

When I pass this variable to a template, I want it to be rendered as raw

3条回答
  •  北荒
    北荒 (楼主)
    2021-02-08 15:37

    You pretty much covered it, those are indeed all the ways to disable autoescaping.

    Are you sure the value you are talking about is actually s = '

    Hello!

    '?

    My hunch is that you have additional escaping somewhere in that string...

提交回复
热议问题