BorisMoore / jquery-tmpl

The original official jQuery Templates plugin. This project was maintained by the jQuery team as an official jQuery plugin. It is no longer in active development, and has been superseded by JsRender.
3.23k stars 1.01k forks source link

Possibility to change delimiters from curly braces #165

Open nagyt234 opened 12 years ago

nagyt234 commented 12 years ago

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.

rdworth commented 12 years ago

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

fedeghe commented 11 years ago

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

xiunen commented 11 years ago

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