From 9a78edaee74a8355d49ec930c82e118518d5d625 Mon Sep 17 00:00:00 2001 From: praschke Date: Tue, 17 Oct 2023 21:23:47 +0100 Subject: fix: dumpObject --- docs/templates.md | 4 ++-- ext/js/templates/sandbox/anki-template-renderer.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/templates.md b/docs/templates.md index 778b8e2d..c050889f 100644 --- a/docs/templates.md +++ b/docs/templates.md @@ -14,7 +14,7 @@ This function can be helpful for debugging values when creating templates.
Syntax: - {{#dumpObject}}<object>{{/dumpObject}} + {{dumpObject object}} * _`object`_
The object to convert. @@ -23,7 +23,7 @@ This function can be helpful for debugging values when creating templates. Example: ```handlebars -
{{#dumpObject}}{{.}}{{/dumpObject}}
+
{{dumpObject .}}
``` Output: diff --git a/ext/js/templates/sandbox/anki-template-renderer.js b/ext/js/templates/sandbox/anki-template-renderer.js index 789f0942..9e0bc8ed 100644 --- a/ext/js/templates/sandbox/anki-template-renderer.js +++ b/ext/js/templates/sandbox/anki-template-renderer.js @@ -134,8 +134,8 @@ class AnkiTemplateRenderer { // Template helpers - _dumpObject(context, options) { - const dump = JSON.stringify(options.fn(context), null, 4); + _dumpObject(context, object) { + const dump = JSON.stringify(object, null, 4); return this._escape(dump); } -- cgit v1.2.3