Aftershock
Aftershock

Reputation: 5351

How to escape single quotes in Template Toolkit?

I am converting Template Toolkit 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 '?

Upvotes: 1

Views: 693

Answers (1)

Ashley
Ashley

Reputation: 4335

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'") %]

Upvotes: 5

Related Questions