Add a note about escaping braces in the editor templates

This commit is contained in:
Kovid Goyal 2014-09-13 09:43:27 +05:30
parent 0e40a2550e
commit 37c2044c6f

View File

@ -538,7 +538,9 @@ class TemplatesDialog(Dialog): # {{{
self.helpl = la = QLabel(_( self.helpl = la = QLabel(_(
'The variables {0} and {1} will be replaced with the title and author of the book. {2}' 'The variables {0} and {1} will be replaced with the title and author of the book. {2}'
' is where the cursor will be positioned.').format('{TITLE}', '{AUTHOR}', '%CURSOR%')) ' is where the cursor will be positioned. If you want to include braces in your template,'
' for example for CSS rules, you have to escape them, like this: {3}').format(*['<code>%s</code>'%x for x in
['{TITLE}', '{AUTHOR}', '%CURSOR%', 'body {{ color: red }}']]))
la.setWordWrap(True) la.setWordWrap(True)
l.addRow(la) l.addRow(la)