Extending auto_literal to handle {{ and }}

88 views
Skip to first unread message

Mark Rogers

unread,
Aug 8, 2017, 11:03:18 AM8/8/17
to smarty-d...@googlegroups.com
At present, auto_literal interprets whitespace inside the left/right delimiters as meaning those delimiters should be treated as literals.

Is there any reason why this couldn't be extended to include {{ and }}?

(Or to put it another way, is there any legitimate reason why a Smarty template which uses the standard { and } as delimiters would ever use {{ and }} in anything other than a literal context?)

I'm experimenting with ractive.js which makes heavy use of {{ and }}. I have created a pre-filter but ideally Smarty would know that {{ isn't a valid left delimiter just because { is.

Alternatively, is there any way to override the set of "whitespace" characters that Smarty accepts within the delimiters as an indication that the delimiters should be treated literally? 
--
Mark Rogers // More Solutions Ltd (Peterborough Office) // 0844 251 1450
Registered in England (0456 0902) 21 Drakes Mews, Milton Keynes, MK8 0ER

uwe.tews

unread,
Aug 9, 2017, 7:22:10 AM8/9/17
to Smarty Developers
I just have modified the  code that repeated delimiter like {{ and }} will be treated as a literal.

or visit the Git repository at https://github.com/smarty-php/smarty

It will later be included in the 3.1.32 release

Regards Uwe


Mark Rogers

unread,
Aug 9, 2017, 9:09:51 AM8/9/17
to smarty-d...@googlegroups.com
That's fantastic news, thanks!

--
You received this message because you are subscribed to the Google Groups "Smarty Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smarty-developers+unsubscribe@googlegroups.com.
To post to this group, send email to smarty-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/smarty-developers.
For more options, visit https://groups.google.com/d/optout.

uwe.tews

unread,
Oct 7, 2017, 5:22:11 AM10/7/17
to Smarty Developers
Dear Mark  
My modification hab some side effect. The code was updated again.

Please read also the NEW  FEATURES

Mark Rogers

unread,
Oct 11, 2017, 5:08:12 AM10/11/17
to smarty-d...@googlegroups.com
Thank you for the update - I'll check it out!
Reply all
Reply to author
Forward
0 new messages