aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpraschke <stel@comfy.monster>2023-10-17 21:23:47 +0100
committerpraschke <stel@comfy.monster>2023-10-17 21:23:47 +0100
commit9a78edaee74a8355d49ec930c82e118518d5d625 (patch)
tree7553667f28c5ab5e49d6060357efb3628c14116b
parent0506cfbee5443635ebd6ac79054b85f171775039 (diff)
fix: dumpObject
-rw-r--r--docs/templates.md4
-rw-r--r--ext/js/templates/sandbox/anki-template-renderer.js4
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.
<details>
<summary>Syntax:</summary>
- <code>{{#dumpObject}}<i>&lt;object&gt;</i>{{/dumpObject}}</code>
+ <code>{{dumpObject <i>object</i>}}</code>
* _`object`_ <br>
The object to convert.
@@ -23,7 +23,7 @@ This function can be helpful for debugging values when creating templates.
<summary>Example:</summary>
```handlebars
- <pre>{{#dumpObject}}{{.}}{{/dumpObject}}</pre>
+ <pre>{{dumpObject .}}</pre>
```
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);
}