diff --git a/HISTORY.md b/HISTORY.md index 267778a..c94dde6 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,8 @@ +unreleased +========== + + * Support using tokens multiple times + 1.3.1 / 2014-10-01 ================== diff --git a/index.js b/index.js index ca6198f..da2749d 100644 --- a/index.js +++ b/index.js @@ -172,10 +172,10 @@ exports.html = function(req, res, files, next, dir, showUp, icons, path, view, t files.sort(fileSort); if (showUp) files.unshift({ name: '..' }); str = str - .replace('{style}', style.concat(iconStyle(files, icons))) - .replace('{files}', html(files, dir, icons, view)) - .replace('{directory}', dir) - .replace('{linked-path}', htmlPath(dir)); + .replace(/\{style\}/g, style.concat(iconStyle(files, icons))) + .replace(/\{files\}/g, html(files, dir, icons, view)) + .replace(/\{directory\}/g, dir) + .replace(/\{linked-path\}/g, htmlPath(dir)); var buf = new Buffer(str, 'utf8'); res.setHeader('Content-Type', 'text/html; charset=utf-8'); diff --git a/test/shared/template.html b/test/shared/template.html index 86ddf0c..04ed760 100644 --- a/test/shared/template.html +++ b/test/shared/template.html @@ -6,6 +6,7 @@