aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/dictionary.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-11-09 16:34:39 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-11-09 16:34:39 -0500
commit184cc4cf28594f3bef9e141a8cbf9d7eb7a39e88 (patch)
tree4b8139029ed0779f35dbcba7bc065edef188cd3b /ext/bg/js/dictionary.js
parent085881d3426c5a872739d56e286514317b2ec8f3 (diff)
Allow templates to be tested on the settings page
Diffstat (limited to 'ext/bg/js/dictionary.js')
-rw-r--r--ext/bg/js/dictionary.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/bg/js/dictionary.js b/ext/bg/js/dictionary.js
index e786c4e2..a4cf34ed 100644
--- a/ext/bg/js/dictionary.js
+++ b/ext/bg/js/dictionary.js
@@ -326,7 +326,7 @@ function dictFieldSplit(field) {
return field.length === 0 ? [] : field.split(' ');
}
-async function dictFieldFormat(field, definition, mode, options) {
+async function dictFieldFormat(field, definition, mode, options, exceptions) {
const data = {
marker: null,
definition,
@@ -347,6 +347,7 @@ async function dictFieldFormat(field, definition, mode, options) {
try {
return await apiTemplateRender(options.anki.fieldTemplates, data, true);
} catch (e) {
+ if (exceptions) { exceptions.push(e); }
return `{${marker}-render-error}`;
}
});