Replace all instances not just the first one

This commit is contained in:
Justin F. Hallett 2016-07-10 13:28:17 -06:00
parent 1846199b77
commit 4e5add0052

View File

@ -100,10 +100,10 @@
var content = $(v).html();
// Add 2 spans, one is dropped when using .html()
var span = $('<span />').append($('<span/>', attrs).append(content));
tmpl = tmpl.replace(reg, span.html());
tmpl = tmpl.replace(new RegExp(reg, 'g'), span.html());
reg = '{col' + k + ':raw}';
tmpl = tmpl.replace(reg, $(v).text());
tmpl = tmpl.replace(new RegExp(reg, 'g'), $(v).text());
});
var $tmpl = $(tmpl);