开发者

How to escape single quotes in Template Toolkit?

开发者 https://www.devze.com 2023-02-07 11:21 出处:网络
I am converting Template Toolki开发者_JAVA百科t files, e.g. Pieces becomes [% l(\'Pieces\') %]. I encountered one problem. What is the proper conversion of \'Title\'? This is not correct: [% l(\'\'Ti

I am converting Template Toolki开发者_JAVA百科t files, e.g. Pieces becomes [% l('Pieces') %].

I encountered one problem. What is the proper conversion of 'Title'? This is not correct: [% l(''Title'') %]

In short, how to escape '?


If I understand you correctly, you can just use alternate quotes. TT approximates regular perl quoting so you can use double or single–

[% l("'Title'") %]
0

精彩评论

暂无评论...
验证码 换一张
取 消