summaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/anki-templates.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/settings/anki-templates.js')
-rw-r--r--ext/bg/js/settings/anki-templates.js18
1 files changed, 16 insertions, 2 deletions
diff --git a/ext/bg/js/settings/anki-templates.js b/ext/bg/js/settings/anki-templates.js
index fb03ef14..87f13100 100644
--- a/ext/bg/js/settings/anki-templates.js
+++ b/ext/bg/js/settings/anki-templates.js
@@ -147,8 +147,22 @@ class AnkiTemplatesController {
renderTemplate: api.templateRender.bind(api),
getClipboardImage: api.clipboardGetImage.bind(api)
});
- const data = ankiNoteBuilder.createNoteData(definition, mode, context, options);
- result = await ankiNoteBuilder.formatField(field, data, templates, exceptions);
+ const {general: {resultOutputMode, compactGlossaries}} = options;
+ const note = await ankiNoteBuilder.createNote({
+ definition,
+ mode,
+ context,
+ templates,
+ resultOutputMode,
+ compactGlossaries,
+ modeOptions: {
+ fields: {field},
+ deck: '',
+ model: ''
+ },
+ errors: exceptions
+ });
+ result = note.fields.field;
}
} catch (e) {
exceptions.push(e);