From 8179846e381eb0a87bf3bc266abec8f4400565bc Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 2 Apr 2021 12:42:06 -0400 Subject: Refactor template rendering (#1583) * Update _errorToJson to _serializeError * Remove async * Refactor render * Simplify _getModifiedData * Rename data => commonData * Rename templates => template for consistency * Improve errors check * Update tests --- ext/js/display/display.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/js/display') diff --git a/ext/js/display/display.js b/ext/js/display/display.js index 1e5c569d..ce4459fe 100644 --- a/ext/js/display/display.js +++ b/ext/js/display/display.js @@ -1463,7 +1463,7 @@ class Display extends EventDispatcher { async _createNote(definition, mode, context, injectMedia, errors) { const options = this._options; - const templates = this._ankiFieldTemplates; + const template = this._ankiFieldTemplates; const { general: {resultOutputMode, glossaryLayoutMode, compactTags}, anki: ankiOptions @@ -1488,7 +1488,7 @@ class Display extends EventDispatcher { definition, mode, context, - templates, + template, deckName, modelName, fields, -- cgit v1.2.3