From a1729cdcce7316060fc1b824591c0f4206d0209c Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 19 Jan 2024 20:41:32 -0500 Subject: Fix AnkiTemplateRenderer again (#535) * Fix args issues in regex functions * Add tests --- ext/js/templates/sandbox/anki-template-renderer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/js') diff --git a/ext/js/templates/sandbox/anki-template-renderer.js b/ext/js/templates/sandbox/anki-template-renderer.js index e4822bee..84f28c1a 100644 --- a/ext/js/templates/sandbox/anki-template-renderer.js +++ b/ext/js/templates/sandbox/anki-template-renderer.js @@ -248,7 +248,7 @@ export class AnkiTemplateRenderer { const argCount = args.length; let value = this._computeValueString(options, context); if (argCount > 3) { - value = `${args.slice(3, -1).join('')}${value}`; + value = `${args.slice(3).join('')}${value}`; } if (argCount > 1) { try { @@ -276,7 +276,7 @@ export class AnkiTemplateRenderer { const argCount = args.length; let value = this._computeValueString(options, context); if (argCount > 2) { - value = `${args.slice(2, -1).join('')}${value}`; + value = `${args.slice(2).join('')}${value}`; } if (argCount > 0) { try { -- cgit v1.2.3