2012-07-19 76 views
0

我试图想出一个方法来使用jinja来转义某个css类。例如:转义指定的CSS类

<div class="code"> <center> ... more example html code ... </center> </div> 

其中

<center> 

标签明显写在后。再次,我只想要代码类逃脱。任何提示?

回答

1

如果你只想逃脱类的代码,那么你需要在把它作为一个独立的变量,像这样:

{{ classcode|e }}{{ Your other unescaped code here }} 

我希望这可以帮助你。