diff options
Diffstat (limited to 'ext/js/display')
-rw-r--r-- | ext/js/display/display-anki.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ext/js/display/display-anki.js b/ext/js/display/display-anki.js index 23f7157f..6a6ec215 100644 --- a/ext/js/display/display-anki.js +++ b/ext/js/display/display-anki.js @@ -21,6 +21,7 @@ import {log} from '../core/log.js'; import {toError} from '../core/to-error.js'; import {deferPromise} from '../core/utilities.js'; import {AnkiNoteBuilder} from '../data/anki-note-builder.js'; +import {getDynamicTemplates} from '../data/anki-template-util.js'; import {invalidNoteId, isNoteDataValid} from '../data/anki-util.js'; import {PopupMenu} from '../dom/popup-menu.js'; import {querySelectorNotNull} from '../dom/query-selector.js'; @@ -659,6 +660,16 @@ export class DisplayAnki { * @returns {Promise<string>} */ async _getAnkiFieldTemplates(options) { + const staticTemplates = await this._getStaticAnkiFieldTemplates(options); + const dynamicTemplates = getDynamicTemplates(options); + return staticTemplates + dynamicTemplates; + } + + /** + * @param {import('settings').ProfileOptions} options + * @returns {Promise<string>} + */ + async _getStaticAnkiFieldTemplates(options) { let templates = options.anki.fieldTemplates; if (typeof templates === 'string') { return templates; } |