summaryrefslogtreecommitdiff
path: root/ext/bg/js/settings
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-03-07 15:20:45 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-03-07 21:47:48 -0500
commit7ac1c843a92cbefd0a625f06b5093217b585f7cf (patch)
tree291abdc5aaa3e9347676c1aa452192ddc8184c0d /ext/bg/js/settings
parent69cce49b0d5d9f11f4ffb529ae3d060536297c07 (diff)
Use dependency injection for apiTemplateRender
Diffstat (limited to 'ext/bg/js/settings')
-rw-r--r--ext/bg/js/settings/anki-templates.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/bg/js/settings/anki-templates.js b/ext/bg/js/settings/anki-templates.js
index 32a990f9..b1665048 100644
--- a/ext/bg/js/settings/anki-templates.js
+++ b/ext/bg/js/settings/anki-templates.js
@@ -18,7 +18,7 @@
/*global getOptionsContext, getOptionsMutable, settingsSaveOptions
ankiGetFieldMarkers, ankiGetFieldMarkersHtml
-apiOptionsGet, apiTermsFind, apiGetDefaultAnkiFieldTemplates,
+apiOptionsGet, apiTermsFind, apiGetDefaultAnkiFieldTemplates, apiTemplateRender
AnkiNoteBuilder*/
function onAnkiFieldTemplatesReset(e) {
@@ -93,7 +93,7 @@ async function ankiTemplatesValidate(infoNode, field, mode, showSuccessResult, i
const options = await apiOptionsGet(optionsContext);
let templates = options.anki.fieldTemplates;
if (typeof templates !== 'string') { templates = await apiGetDefaultAnkiFieldTemplates(); }
- const ankiNoteBuilder = new AnkiNoteBuilder();
+ const ankiNoteBuilder = new AnkiNoteBuilder({renderTemplate: apiTemplateRender});
result = await ankiNoteBuilder.formatField(field, definition, mode, options, templates, exceptions);
}
} catch (e) {