diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/codeq/template.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/js/codeq/template.js b/js/codeq/template.js index ec8b080..86d8116 100644 --- a/js/codeq/template.js +++ b/js/codeq/template.js @@ -117,13 +117,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ key, subpart, start, end, match, handler, output = ''; - // escape arguments - args = args || {}; - for (key in args) { - if (!args.hasOwnProperty(key)) continue; - args[key] = codeq.escapeHtml(args[key]); - } - if (!templatePath) templatePath = []; templateName = templatePath.join('/'); @@ -151,7 +144,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ } switch (match[1]) { case '=': // a value reference - output += String(args[match[2]]); + var value = args[match[2]]; + if (Array.isArray(value)) { + var i; + for (i = 0; i < value.length; i++) { + output += '<li>' + codeq.escapeHtml(value[i]) + '</li>'; + } + } + else { + output += codeq.escapeHtml(value); + } break; case '@': // a directive handler = directiveHandlers[match[2]]; |