jquery-tmpl icon indicating copy to clipboard operation
jquery-tmpl copied to clipboard

Possibility to change delimiters from curly braces

Open nagyt234 opened this issue 13 years ago • 3 comments

It would be very nice if it was possible to change the symbols used as delimiters, since the { }-delimeters conflicts with the template system we're currently using.

nagyt234 avatar Jun 14 '12 10:06 nagyt234

Do take note of the message on the homepage

"A templating plugin for jQuery. BETA. NO LONGER IN ACTIVE DEVELOPMENT OR MAINTENANCE. Issues remain open but are not being worked."

as well as in the README

rdworth avatar Jun 14 '12 10:06 rdworth

if u can forget about cache

function replaceall(tpl, o, dD, Dd) {
    var reg = new RegExp((dD || '%') + '([A-z0-9-_]*)' + (Dd || '%'), 'g'), str;
    return tpl.replace(reg, function (str, $1) {return o[$1] || $1; });
}

hope it helps

fedeghe avatar Jan 02 '13 15:01 fedeghe

${word} is a element show in the template, not the template variable. how can i make it possible.

xiunen avatar Apr 17 '13 02:04 xiunen